<template>
  <div class="shipment">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span style="line-height: 36px;">发运订单管理</span>
        <el-button style="float: right; margin-left: 5px" type="primary" @click="dialogOpen('add')" v-if="USER.auth.indexOf('outOperation_shipment_add')!==-1">新增发运订单</el-button>
        <el-button style="float: right;" type="success" @click="dialogUploadOpen('ZX')" v-if="USER.auth.indexOf('outOperation_shipment_import')!==-1">直销导入</el-button>
        <el-button style="float: right;" type="success" @click="dialogUploadOpen('OA')" v-if="USER.auth.indexOf('outOperation_shipment_import')!==-1">OA导入</el-button>
        <el-button style="float: right;" type="warning" @click="dialogConfigureOpen">导入配置信息</el-button>
        <el-button style="float: right;" type="warning" @click="tableMutiPrint('')">批量打印箱标签</el-button>
        <el-button style="float: right; margin-left: 5px" type="primary" @click="dialogprintOpen('')">批量打印快递面单</el-button>
      </div>
      <s-table
        :table="table"
        :multiSelect="true"
        ref="table"
        @http="tableWatch">
        <el-table-column
          fixed="right"
          align="center"
          slot="operation"
          class-name="operationMore"
          label="可用操作"
          width="125">
          <template slot-scope="s">
            <!--打印按钮-->
            <el-tooltip class="item" effect="dark" content="打印快递面单" placement="top">
              <el-button type="success" size="mini" @click="Printing(s.row)" v-if="(s.row.cyslb==='3' || s.row.cyslb ==='6') && s.row.zxzt !== '0'"><i class="fa fa-print" aria-hidden="true"></i></el-button>
            </el-tooltip>

            <el-button type="info" size="mini" @click="dialogSearchOpen(s.row)" icon="search"></el-button>
            <el-button type="success" icon="edit" size="mini" @click="dialogOpen('put', s.row)" v-if="USER.auth.indexOf('outOperation_shipment_edit')!==-1 && s.row.cdzt === '0'"></el-button>
            <el-button type="danger" icon="delete" size="mini" @click="tableDelete(s.row)" v-if="USER.auth.indexOf('outOperation_shipment_disable')!==-1 && s.row.cdzt === '0'"></el-button>
            <el-button type="info" size="mini" @click="tablePrint(s.row)" v-if="s.row.zxzt!=='0'"><i class="fa fa-print" aria-hidden="true"></i></el-button>
            <el-tooltip placement="top">
              <div slot="content">更多可用操作</div>
              <el-popover
                popper-class="demo-table-expand"
                placement="right"
                title="更多可用操作"
                trigger="click">
                <slot name="content">
                  <div>
                    <el-button type="info" size="mini" @click="dialogCreateOpen(s.row)">修改承运商类别</el-button>
                    <el-button type="info" size="mini" @click="dialogStockOpen(s.row)">查看库存余量</el-button>
                    <el-button type="info" size="mini" @click="tablecopyBillList(s.row)">复制订单</el-button>
                    <el-button type="info" size="mini" @click="dialogUploadOpen2(s.row.id)">附件管理</el-button>
                    <el-button type="info" size="mini" @click="tableDeductible(s.row)" v-if="s.row.show_fylx === '抵扣'">抵扣审核</el-button>
                    <el-button type="info" size="mini" @click="tableBorrow(s.row)" v-if="s.row.show_fylx ==='借货' && s.row.jhwjzt==='0'">借货完结</el-button>
                    <el-button type="info" size="mini" @click="dialogBackOpen(s.row)" v-if="(s.row.fyzt ==='3' || s.row.fyzt==='4' || s.row.fyzt ==='0') && (s.row.thzt === '0') && (s.row.tdzt!=='2')">退单重报</el-button>
                    <el-button type="info" size="mini" @click="tableBackList(s.row)" v-if="s.row.fyzt === '0'">退单</el-button>
                    <el-button type="warning"  size="mini" @click="tableComplete(s.row)" v-if="USER.auth.indexOf('outOperation_shipment_sign')!==-1 && s.row.fyzt === '3'">标记</el-button>
                    <el-button type="info"  size="mini" @click="tableCreate(s.row)" v-if="USER.auth.indexOf('outOperation_shipment_create')!==-1 && s.row.bczt ==='0'&& s.row.fyzt ==='0'">创建波次</el-button>
                    <el-button type="success"  size="mini" @click="tableRemove(s.row)" v-if="USER.auth.indexOf('outOperation_shipment_remove')!==-1 && s.row.shzt ==='1' && s.row.cdzt === '0'">订单拆单</el-button>
                    <el-button type="success"  size="mini" @click="tableCancel(s.row)" v-if="USER.auth.indexOf('outOperation_shipment_cancel')!==-1 && s.row.cdzt==='1' && s.row.fyzt ==='0'">取消拆单</el-button>
                    <el-button type="warning"  size="mini" @click="tableAllot(s.row)" v-if="USER.auth.indexOf('outOperation_shipment_allot')!==-1 && s.row.cdzt==='1'&& s.row.fyzt ==='0' && s.row.jhrwzt ==='0'">分配</el-button>
                    <el-button type="warning"  size="mini" @click="tableCancelAllot(s.row)" v-if="USER.auth.indexOf('business_customerFile_search')!==-1 && (s.row.jhzt ==='0'&& s.row.zxzt==='0' && s.row.fyzt !=='0' && s.row.jhrwzt ==='0')">取消分配</el-button>
                    <el-button type="info"  size="mini" @click="tablePacking(s.row)" v-if="USER.auth.indexOf('outOperation_shipment_packing')!==-1 && (s.row.fyzt ==='1' || s.row.fyzt ==='2') && (s.row.zxzt ==='0' || s.row.zxzt ==='1') &&  (s.row.cdzt==='1') && s.row.jhrwzt ==='0'">装箱</el-button>
                    <el-button type="success"  size="mini" @click="tablePicking(s.row)" v-if="USER.auth.indexOf('outOperation_shipment_picking')!==-1 && (s.row.fyzt==='1'|| s.row.fyzt==='2') && s.row.jhrwzt !=='2' && s.row.jhzt ==='0'">拣货</el-button>
                    <el-button type="warning"  size="mini" @click="tableCancelPacking(s.row)" v-if="USER.auth.indexOf('business_customerFile_search')!==-1 && (s.row.zxzt ==='1' || s.row.zxzt === '2') && s.row.jhrwzt ==='0' && s.row.jhzt ==='0'">取消装箱</el-button>
                    <el-button type="warning"  size="mini" @click="dialogSplitSingleDetailedOpen(s.row)" v-if="USER.auth.indexOf('outOperation_shipment_splitsingledetailed')!==-1">查看拆单明细</el-button>
                    <el-button type="warning"  size="mini" @click="dialogAllotDetailedOpen(s.row)" v-if="USER.auth.indexOf('outOperation_shipment_allotdetailed')!==-1">查看分配明细</el-button>
                    <el-button type="warning"  size="mini" @click="dialogPackingDetailedOpen(s.row)">查看装箱明细</el-button>
                    <!--
                    <el-button type="warning"  size="mini" @click="tablePackingDetailed(s.row)" v-if="USER.auth.indexOf('outOperation_shipment_packingdetailed')!==-1">查看装箱明细</el-button>
                    -->
                  </div>
                </slot>
                <el-button slot="reference" type="info" icon="more" :plain="true" size="mini" class="__reference"></el-button>
              </el-popover>
            </el-tooltip>
          </template>
        </el-table-column>
        <el-row>
          <el-col :xs="24" :lg="{span: 5, offset: 0}">
            <el-form-item label="自定列名">
              <el-select
                class="__tabel_column"
                name="testSelet1"
                value-key="prop"
                multiple-limit.number="4"
                v-model="table.tableColumn" multiple placeholder="请选择">
                <el-option
                  v-for="item in table.tableColumnAll"
                  :key="item.prop"
                  :label="item.label"
                  :value="item">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="审核状态" prop="shzt">
              <el-select v-model="autoVue_table_shzt"
                         placeholder="是否审核">
                <el-option
                  label="全部"
                  value=""></el-option>
                <el-option
                  label="未审核"
                  value="0"></el-option>
                <el-option
                  label="已审核"
                  value="1"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="拣货状态" prop="jhzt">
              <el-select v-model="autoVue_table_jhzt"
                         placeholder="拣货状态">
                <el-option
                  label="全部"
                  value=""></el-option>
                <el-option
                  v-for="item in SHIPMENT.jhzt"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="波次状态" prop="bczt">
              <el-select v-model="autoVue_table_bczt"
                         placeholder="是否加入">
                <el-option
                  label="全部"
                  value=""></el-option>
                <el-option
                  label="未加入"
                  value="0"></el-option>
                <el-option
                  label="已加入"
                  value="1"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="拆单状态" prop="cdzt">
              <el-select v-model="autoVue_table_cdzt"
                         placeholder="是否拆弹">
                <el-option
                  label="全部"
                  value=""></el-option>
                <el-option
                  label="未拆单"
                  value="0"></el-option>
                <el-option
                  label="已拆单"
                  value="1"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="装箱状态" prop="zxzt">
              <el-select v-model="autoVue_table_zxzt"
                         placeholder="装箱状态">
                <el-option
                  label="全部"
                  value=""></el-option>
                <el-option
                  v-for="item in SHIPMENT.zxzt"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="可用操作" prop="kycz">
              <div class="s-content">
                <el-button @click="tableSetSearch('table')" size="small">重置搜索</el-button>
              </div>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 6, offset: 0}">
            <el-form-item label="订单号" prop="khddh">
              <el-input type="text"
                        class="input"
                        v-model="autoVue_table_khddh"
                        placeholder="客户订单号" spellcheck="false" auto-capitalize="off" auto-complete="off"
                        auto-correct="off"></el-input>
            </el-form-item>
            <el-form-item label="路线名称" prop="xl">
              <el-input type="text"
                        class="input"
                        v-model="autoVue_table_xl"
                        placeholder="路线" spellcheck="false" auto-capitalize="off" auto-complete="off"
                        auto-correct="off"></el-input>
            </el-form-item>
            <el-form-item label="联系人员" prop="lxrxm">
              <el-input type="text"
                        class="input"
                        v-model="autoVue_table_lxrxm"
                        placeholder="联系人" spellcheck="false" auto-capitalize="off" auto-complete="off"
                        auto-correct="off"></el-input>
            </el-form-item>
            <el-form-item label="SO编号" prop="fybh">
              <el-input type="text"
                        class="input"
                        v-model="autoVue_table_fybh"
                        placeholder="SO编号" spellcheck="false" auto-capitalize="off" auto-complete="off"
                        auto-correct="off"></el-input>
            </el-form-item>
            <el-form-item label="客户地址" prop="khdz">
              <el-input type="text"
                        class="input"
                        v-model="autoVue_table_khdz"
                        placeholder="客户地址" spellcheck="false" auto-capitalize="off" auto-complete="off"
                        auto-correct="off"></el-input>
            </el-form-item>
            <el-form-item label="订单类型" prop="fylx">
              <el-select v-model="autoVue_table_fylx"
                         filterable
                         remote
                         placeholder="请选择订单类型">
                <el-option
                  v-for="item in dialog.wmsPurchaseOrder"
                  :key="item.id"
                  :label="item.ddlx"
                  :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="客户编号" prop="khbh">
              <el-input type="text"
                        class="input"
                        v-model="autoVue_table_khbh"
                        placeholder="客户编号" spellcheck="false" auto-capitalize="off" auto-complete="off"
                        auto-correct="off"></el-input>
            </el-form-item>
            <el-form-item label="客户名称" prop="khmc">
              <el-input type="text"
                        class="input"
                        v-model="autoVue_table_khmc"
                        placeholder="客户名称" spellcheck="false" auto-capitalize="off" auto-complete="off"
                        auto-correct="off"></el-input>
            </el-form-item>
            <el-form-item label="波次编号" prop="bcbh">
              <el-input type="text"
                        class="input"
                        v-model="autoVue_table_bcbh"
                        placeholder="波次编号" spellcheck="false" auto-capitalize="off" auto-complete="off"
                        auto-correct="off"></el-input>
            </el-form-item>
            <el-form-item label="货品编号" prop="hpbh">
              <el-input type="text"
                        class="input"
                        v-model="autoVue_table_hpbh"
                        placeholder="货品编号" spellcheck="false" auto-capitalize="off" auto-complete="off"
                        auto-correct="off"></el-input>
            </el-form-item>
            <el-form-item label="打印状态" prop="print">
              <el-select v-model="autoVue_table_print"
                         placeholder="打印状态">
                <el-option
                  label="全部"
                  value=""></el-option>
                <el-option
                  label="不可打印"
                  value="0"></el-option>
                <el-option
                  label="待打印"
                  value="1"></el-option>
                <el-option
                  label="已打印"
                  value="2"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 6, offset: 0}">
            <el-form-item label="交货方式" prop="jhfs">
              <el-select v-model="autoVue_table_jhfs"
                         placeholder="交货方式">
                <el-option
                  label="全部"
                  value=""></el-option>
                <el-option
                  label="发运"
                  value="0"></el-option>
                <el-option
                  label="自提"
                  value="1"></el-option>
                <el-option
                  label="到付"
                  value="2"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="SO状态" prop="fyzt">
              <el-select v-model="autoVue_table_fyzt"
                         placeholder="SO状态">
                <el-option
                  label="全部"
                  value=""></el-option>
                <el-option
                  v-for="item in SHIPMENT.fyzt"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="货品名称" prop="hpmc">
              <el-input type="text"
                        class="input"
                        v-model="autoVue_table_hpmc"
                        placeholder="货品名称" spellcheck="false" auto-capitalize="off" auto-complete="off"
                        auto-correct="off"></el-input>
            </el-form-item>
            <el-form-item label="客户等级" prop="khdj">
              <el-input type="text"
                        class="input"
                        v-model="autoVue_table_khdj"
                        placeholder="客户等级" spellcheck="false" auto-capitalize="off" auto-complete="off"
                        auto-correct="off"></el-input>
            </el-form-item>
            <el-form-item label="创建时间" prop="khcjsj">
              <el-date-picker
                v-model="autoVue_table_khcjsj"
                type="daterange"
                placeholder="客户创建时间">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="创建时间" prop="cjsj">
              <el-date-picker
                v-model="autoVue_table_cjsj"
                type="daterange"
                placeholder="WMS创建时间">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="优先级" prop="yxj">
              <el-select v-model="autoVue_table_yxj"
                         placeholder="优先级">
                <el-option
                  label="全部"
                  value=""></el-option>
                <el-option
                  v-for="item in SHIPMENT.yxj"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="发货时间" prop="jhfhsj">
              <el-date-picker
                v-model="autoVue_table_jhfhsj"
                type="daterange"
                placeholder="计划发货时间">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="交货时间" prop="yqjhsj">
              <el-date-picker
                v-model="autoVue_table_yqjhsj"
                type="daterange"
                placeholder="要求交货时间">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="承运商" prop="cyslb">
              <el-select v-model="autoVue_table_cyslb"
                         placeholder="承运商类别">
                <el-option
                  label="全部"
                  value=""></el-option>
                <el-option
                  v-for="item in SHIPMENT.cyslb"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 6, offset: 0}">
            <el-form-item label="启用多选" prop="multiSelect">
              <el-switch
                v-model="table.multiSelect"
                on-color="#13ce66"
                off-color="#ff4949">
              </el-switch>
              <el-button @click="clearMuti('table')" type="danger" size="small" style="margin-left: 25px" v-if="table.multiSelect">清空选择</el-button>
            </el-form-item>
            <transition name="el-zoom-in-top">
              <el-form-item label="多选操作" prop="multiSelect" v-if="table.multiSelect">
                <el-row>
                  <el-col :span="10">
                    <el-button size="small" type="danger" @click="tableDelete('')" v-if="USER.auth.indexOf('outOperation_shipment_disable')!==-1">多选删除</el-button>
                  </el-col>
                  <el-col :span="10">
                    <el-button size="small" type="info" @click="tableExamine('')" v-if="USER.auth.indexOf('outOperation_shipment_examine')!==-1">多选审核</el-button>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="10">
                    <el-button size="small" type="info" @click="tableComplete('')" v-if="USER.auth.indexOf('outOperation_shipment_sign')!==-1">多选标记</el-button>
                  </el-col>
                  <el-col :span="10">
                    <el-button size="small" type="info" @click="tableCreate('')" v-if="USER.auth.indexOf('outOperation_shipment_create')!==-1">创建波次</el-button>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="10">
                    <el-button size="small" type="info" @click="tableRemove('')" v-if="USER.auth.indexOf('outOperation_shipment_remove')!==-1">订单拆单</el-button>
                  </el-col>
                  <el-col :span="10">
                    <el-button size="small" type="info" @click="tableCancel('')" v-if="USER.auth.indexOf('outOperation_shipment_cancel')!==-1">取消拆单</el-button>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="10">
                    <el-button size="small" type="info" @click="tableAllot('')" v-if="USER.auth.indexOf('outOperation_shipment_allot')!==-1">多选分配</el-button>
                  </el-col>
                  <el-col :span="10">
                    <el-button size="small" type="info" @click="tableDeductible('')" >抵扣审核</el-button>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="10">
                    <el-button size="small" type="info" @click="tableCancelAllot('')">取消分配</el-button>
                  </el-col>
                  <el-col :span="10">
                    <el-button size="small" type="info" @click="tablePicking('')">多选拣货</el-button>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="10">
                    <el-button size="small" type="info" @click="tablePacking('')">多选装箱</el-button>
                  </el-col>
                  <el-col :span="10">
                    <el-button size="small" type="info" @click="tableCancelPacking('')" >取消装箱</el-button>
                  </el-col>
                  <!--<el-col :span="8">
                    <el-button size="small" type="info" @click="tableMultiPrint">多选打印</el-button>
                  </el-col>-->
                </el-row>
                <el-row>
                  <el-col :span="10">
                    <el-button size="small" type="info" @click="dialogCysOpen('table')">承运商类别</el-button>
                  </el-col>
                  <el-col :span="10">
                    <el-button size="small" type="info" @click="tableExport">多选导出</el-button>
                  </el-col>
                </el-row>
              </el-form-item>
            </transition>
          </el-col>
        </el-row>
      </s-table>
    </el-card>
    <s-dialog :dialog="dialog" :close="dialogInit">
      <p slot="title">{{dialog.title}}发运订单 <span>{{USER.user.orgName}}</span></p>
      <el-tabs v-model="dialog.activeName" v-if="dialog.title === '新增'">
        <el-tab-pane label="发运订单表头" name="1" disabled>
          <s-form :form="formDialog1" ref="formDialog1">
            <el-row>
              <el-col :xs="24" :lg="{span: 7, offset: 0}" class="">
                <el-form-item prop="fybh" label="SO编号">
                  <el-input
                    type="text"
                    v-model="formDialog1.fybh"
                    placeholder="SO编号"></el-input>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
                <el-form-item prop="yxj" label="优先级">
                  <el-select v-model="formDialog1.yxj" placeholder="请选择">
                    <el-option
                      v-for="item in SHIPMENT.yxj"
                      :key="item.dictionaryid"
                      :label="item.value"
                      :value="item.dictionaryid">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
                <el-form-item prop="khid" label="客户编号">
                  <el-select v-model="formDialog1.khid"
                             filterable
                             remote
                             placeholder="请选择客户编号"
                             @change="dialogRemoteKhbhid"
                             :remote-method="dialogRemoteKhbh">
                    <el-option
                      v-for="item in dialog.wmsshipmentorder"
                      :key="item.id"
                      :label="item.khbh + '  ' + item.khmc"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 23, offset: 0}">
                <el-collapse v-model="dialog.activeNameCollapse" accordion v-if="formDialog1.khid">
                  <el-collapse-item title="客户详情" name="1">
                    <el-row>
                      <el-col :xs="24" :lg="{span: 7, offset: 0}" class="">
                        <el-form-item prop="khmc" label="客户名称">
                          <el-input
                            type="text"
                            disabled
                            v-model="formDialog1.khmc"
                            placeholder="客户名称"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
                        <el-form-item prop="xlmc" label="路线名称">
                          <el-input
                            type="text"
                            disabled
                            v-model="formDialog1.xlmc"
                            placeholder="路线名称"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :xs="24" :lg="{span: 8, offset: 1}" class="">
                        <el-form-item prop="lxrdh" label="联系电话">
                          <el-input
                            type="text"
                            disabled
                            v-model="formDialog1.lxrdh"
                            placeholder="联系电话"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :xs="24" :lg="{span: 7, offset: 0}" class="">
                        <el-form-item prop="lxrxm" label="联系人">
                          <el-input
                            type="text"
                            disabled
                            v-model="formDialog1.lxrxm"
                            placeholder="联系人"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :xs="24" :lg="{span: 16, offset: 1}" class="">
                        <el-form-item prop="khdz" label="客户地址">
                          <el-input
                            type="text"
                            disabled
                            v-model="formDialog1.khdz"
                            placeholder="客户地址"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                  </el-collapse-item>
                </el-collapse>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 7, offset: 0}" class="">
                <el-form-item prop="jhfhsj" label="计划发货">
                  <el-date-picker
                    v-model="formDialog1.jhfhsj"
                    type="datetime"
                    placeholder="选择发货时间">
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
                <el-form-item prop="yqjhsj" label="要求交货">
                  <el-date-picker
                    v-model="formDialog1.yqjhsj"
                    type="datetime"
                    placeholder="选择交货时间">
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
                <el-form-item prop="jhfs" label="交货方式">
                  <el-select v-model="formDialog1.jhfs" placeholder="请选择">
                    <el-option
                      v-for="item in SHIPMENT.jhfs"
                      :key="item.dictionaryid"
                      :label="item.value"
                      :value="item.dictionaryid">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 7, offset: 0}" class="">
                <el-form-item prop="khddh" label="客户订单号">
                  <el-input
                    type="text"
                    v-model="formDialog1.khddh"
                    placeholder="客户订单号"></el-input>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
                <el-form-item prop="fylx" label="订单类型">
                  <el-select v-model="formDialog1.fylx"
                             filterable
                             remote
                             placeholder="请选择订单类型"
                             @change="dialogRemoteLx"
                             :remote-method="dialogRemoteDdlx">
                    <el-option
                      v-for="item in dialog.wmsPurchaseOrder"
                      :key="item.id"
                      :label="item.ddlx"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
                <el-form-item label="审核状态">
                  <div class="s-content">
                    <el-tag type="info">{{formDialog1.zdsh || '请选择订单类型'}}</el-tag>
                  </div>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 23, offset: 0}" class="">
                <el-form-item prop="bz" label="备注">
                  <el-input
                    type="textarea"
                    v-model="formDialog1.bz"
                    placeholder="备注"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </s-form>
        </el-tab-pane>
        <el-tab-pane label="发运订单明细" name="2" disabled>
          <div class="__table">
            <el-button @click="dialogMxOpen('add')" class="__table_button"><i class="el-icon-plus"></i></el-button>
            <s-table :table="tableMx" ref="tableMx" @http="tableWatch" :control="false">
              <el-table-column
                fixed="right"
                align="center"
                slot="operation"
                class-name="operationMore"
                label="操作"
                width="80">
                <template slot-scope="s">
                  <el-button type="success" icon="edit" size="mini" @click="dialogMxOpen('put', s.row)"></el-button>
                  <el-button type="danger" icon="delete" size="mini" @click="tableMxDelete(s.$index)"></el-button>
                </template>
              </el-table-column>
            </s-table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="订单渠道" name="3" disabled>
          <el-row>
            <el-col :xs="24" :lg="10">
              <el-card class="box-card">
                <el-tree
                  :props="{
                label: 'mc',
                children: 'children',
           }"
                  :data="tree.data"
                  :render-content="treeContent"
                  @node-click="treeClick"
                  :default-expand-all = true>
                </el-tree>
              </el-card>
            </el-col>
          </el-row>
        </el-tab-pane>
      </el-tabs>
      <s-form :form="formDialog1" ref="formDialog1" v-else>
        <el-row>
          <el-col :xs="24" :lg="{span: 7, offset: 0}" class="">
            <el-form-item prop="fybh" label="SO编号">
              <el-input
                type="text"
                v-model="formDialog1.fybh"
                placeholder="SO编号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
            <el-form-item prop="yxj" label="优先级">
              <el-select v-model="formDialog1.yxj" placeholder="请选择">
                <el-option
                  v-for="item in SHIPMENT.yxj"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
            <el-form-item prop="khid" label="客户编号">
              <el-select v-model="formDialog1.khid"
                         filterable
                         remote
                         placeholder="请选择客户编号"
                         @change="dialogRemoteKhbhid"
                         :remote-method="dialogRemoteKhbh">
                <el-option
                  v-for="item in dialog.wmsshipmentorder"
                  :key="item.id"
                  :label="item.khbh + '  ' + item.khmc"
                  :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 23, offset: 0}">
            <el-collapse v-model="dialog.activeNameCollapse" accordion v-if="formDialog1.khid">
              <el-collapse-item title="客户详情" name="1">
                <el-row>
                  <el-col :xs="24" :lg="{span: 7, offset: 0}" class="">
                    <el-form-item prop="khmc" label="客户名称">
                      <el-input
                        type="text"
                        disabled
                        v-model="formDialog1.khmc"
                        placeholder="客户名称"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
                    <el-form-item prop="xlmc" label="路线名称">
                      <el-input
                        type="text"
                        disabled
                        v-model="formDialog1.xlmc"
                        placeholder="路线名称"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :lg="{span: 8, offset: 1}" class="">
                    <el-form-item prop="lxrdh" label="联系电话">
                      <el-input
                        type="text"
                        disabled
                        v-model="formDialog1.lxrdh"
                        placeholder="联系电话"></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :xs="24" :lg="{span: 7, offset: 0}" class="">
                    <el-form-item prop="lxrxm" label="联系人">
                      <el-input
                        type="text"
                        disabled
                        v-model="formDialog1.lxrxm"
                        placeholder="联系人"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :lg="{span: 16, offset: 1}" class="">
                    <el-form-item prop="khdz" label="客户地址">
                      <el-input
                        type="text"
                        disabled
                        v-model="formDialog1.khdz"
                        placeholder="客户地址"></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-collapse-item>
            </el-collapse>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 7, offset: 0}" class="">
            <el-form-item prop="jhfhsj" label="计划发货">
              <el-date-picker
                v-model="formDialog1.jhfhsj"
                type="datetime"
                placeholder="选择发货时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
            <el-form-item prop="yqjhsj" label="要求交货">
              <el-date-picker
                v-model="formDialog1.yqjhsj"
                type="datetime"
                placeholder="选择交货时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
            <el-form-item prop="jhfs" label="交货方式">
              <el-select v-model="formDialog1.jhfs" placeholder="请选择">
                <el-option
                  v-for="item in SHIPMENT.jhfs"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 7, offset: 0}" class="">
            <el-form-item prop="khddh" label="客户订单号">
              <el-input
                type="text"
                v-model="formDialog1.khddh"
                placeholder="客户订单号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
            <el-form-item prop="fylx" label="订单类型">
              <el-select v-model="formDialog1.fylx"
                         filterable
                         remote
                         placeholder="请选择订单类型"
                         @change="dialogRemoteLx"
                         :remote-method="dialogRemoteDdlx">
                <el-option
                  v-for="item in dialog.wmsPurchaseOrder"
                  :key="item.id"
                  :label="item.ddlx"
                  :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
            <el-form-item label="审核状态">
              <div class="s-content">
                <el-tag type="info">{{formDialog1.zdsh}}</el-tag>
              </div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 7, offset: 0}" class="">
            <el-form-item prop="zyf" label="总运费">
              <el-input
                v-model="formDialog1.zyf"
                placeholder="总运费"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 7, offset: 1}" class="">
            <el-form-item prop="bz" label="备注">
              <el-input
                v-model="formDialog1.bz"
                placeholder="备注"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </s-form>
      <el-button slot="footer" v-if="dialog.activeName !== '1'" @click="dialogPre">上一页</el-button>
      <el-button slot="footer" type="info" v-if="dialog.activeName !== '3' && dialog.title === '新增'" @click="dialogNext">下一页</el-button>
      <el-button slot="footer" type="success" v-if="dialog.activeName === '3' || dialog.title !== '新增'" @click="dialogSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogMx" :close="dialogMxInit">
      <p slot="title">{{dialogMx.title}}</p>
      <s-form :form="formDialogMx" ref="formDialogMx">
        <el-row>
          <el-col :xs="24" :lg="{span: 5, offset: 0}" class="">
            <el-form-item prop="bh" label="货品编号">
              <el-select v-model="formDialogMx.bh"
                         filterable
                         remote
                         @change="dialogMxChangeBh"
                         v-on:click.native="dialogMxRemoteBh1"
                         :remote-method="dialogMxRemoteBh"
                         placeholder="请选择货品编号">
                <el-option
                  v-for="item in dialogMx.hpid"
                  :key="item.goodsId"
                  :label="item.goodsBh"
                  :value="item.goodsBh">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 5, offset: 1}" class="">
            <el-form-item prop="mc" label="货品名称">
              <el-input
                type="text"
                disabled
                v-model="formDialogMx.mc"
                placeholder="货品名称"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 5, offset: 1}" class="">
            <el-form-item prop="bzmc" label="包装名称">
              <el-input
                type="text"
                disabled
                v-model="formDialogMx.bzmc"
                placeholder="包装名称"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 5, offset: 1}" class="">
            <el-form-item prop="ms" label="主单位">
              <el-select v-model="formDialogMx.ms"
                         @change="dialogMxChangeMs"
                         placeholder="请选择主单位">
                <el-option
                  v-for="item in dialogMx.pack"
                  :key="item.id"
                  :label="item.ms"
                  :value="item.ms">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 5, offset: 0}" class="">
            <el-form-item prop="tj" label="体积">
              <el-input
                type="text"
                disabled
                v-model="formDialogMxtj"
                placeholder="体积"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 5, offset: 1}" class="">
            <el-form-item prop="jz" label="净重">
              <el-input
                type="text"
                disabled
                v-model="formDialogMxjz"
                placeholder="净重"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 5, offset: 1}" class="">
            <el-form-item prop="zl" label="毛重">
              <el-input
                type="text"
                disabled
                v-model="formDialogMxzl"
                placeholder="毛重"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 5, offset: 1}" class="">
            <el-form-item prop="je" label="金额">
              <el-input
                type="text"
                disabled
                v-model="formDialogMxje"
                placeholder="金额"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 5, offset: 0}" class="">
            <el-form-item prop="yqsl" label="主单位">
              <el-input
                type="text"
                :disabled="formDialogMx.ms && dialogMx.packValue.bzlx !== '0'"
                v-model="formDialogMx.yqsl"
                placeholder="主单位数量"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 5, offset: 1}" class="">
            <el-form-item prop="yqxdwsl" label="箱单位">
              <el-input
                type="text"
                :disabled="formDialogMx.ms && dialogMx.packValue.bzlx === '0'"
                v-model="formDialogMx.yqxdwsl"
                placeholder="箱单位数量"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 5, offset: 1}" class="">
            <el-form-item prop="kwid" label="指定库位">
              <el-select v-model="formDialogMx.kwid"
                         filterable
                         remote
                         placeholder="请选择库位"
                         @change="dialogChangeKwmc"
                         v-on:click.native="dialogRemoteKwmc1"
                         :remote-method="dialogRemoteKwmc">
                <el-option
                  value=""
                  label="不指定"></el-option>
                <el-option
                  v-for="item in dialogMx.kwid"
                  :key="item.id"
                  :label="item.mc"
                  :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 5, offset: 1}" class="">
            <el-form-item prop="pc" label="指定批次号">
              <el-select v-model="formDialogMx.pc"
                         :disabled="!formDialogMx.bh"
                         filterable
                         remote
                         placeholder="请选择批次号"
                         :remote-method="dialogRemotePch">
                <el-option
                  value=""
                  label="不指定"></el-option>
                <el-option
                  v-for="item in dialogMx.pcid"
                  :key="item.hppc"
                  :label="item.hppc"
                  :value="item.hppc">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 5, offset: 0}" class="">
            <el-form-item prop="scrq" label="指定生产日期">
              <el-select v-model="formDialogMx.scrq"
                         :disabled="!formDialogMx.bh"
                         filterable
                         remote
                         placeholder="请选择生产日期"
                         :remote-method="dialogRemoteScrq">
                <el-option
                  value=""
                  label="不指定"></el-option>
                <el-option
                  v-for="item in dialogMx.rqid"
                  :key="item.scrq"
                  :label="item.scrq"
                  :value="item.scrq">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 5, offset: 1}" class="">
            <el-form-item prop="sum" label="总金额">
              <el-input
                type="text"
                v-model="formDialogMx.sum"
                placeholder="总金额"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 23, offset: 0}" class="">
            <el-form-item prop="bz" label="备注">
              <el-input
                type="textarea"
                v-model="formDialogMx.bz"
                placeholder="备注"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </s-form>
      <el-button slot="footer" @click="dialogMxSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogSplitSingleDetailed">
      <p slot="title">{{dialogSplitSingleDetailed.title}}发运订单行</p>
      <s-table :table="tableSplitSingleDetailed" ref="tableSplitSingleDetailed" :expand="false"  :index="true" @http="tableWatch">
        <el-table-column
          fixed="right"
          align="center"
          slot="operation"
          class-name="operationMore"
          label="可用操作"
          width="125">
          <template slot-scope="s">
            <el-button type="info" size="mini" @click="dialogSplitSingleDetailedMxOpen(s.row)">点击</el-button>
          </template>
        </el-table-column>
      </s-table>
    </s-dialog>
    <s-dialog :dialog="dialogSplitSingleDetailedMx">
      <p slot="title">{{dialogSplitSingleDetailedMx.title}}拆单行</p>
      <s-table :table="tableSplitSingleDetailedMx" ref="tableSplitSingleDetailedMx" :expand="false" :index="true" @http="tableWatch">
      </s-table>
    </s-dialog>
    <s-dialog :dialog="dialogSearch" :close="dialogSearchInit" :closeTip="false">
      <p slot="title">查看明细<span>{{dialogSearch.row.bh}}</span></p>
      <div class="__table">
        <el-button @click="dialogMxOpen('add')"
                   v-if="dialogSearch.row.cdzt == '0'"
                   class="__table_button"><i class="el-icon-plus"></i></el-button>
        <s-table :table="tableSearch" ref='tableSearch' :pagination="false" :control="dialogSearch.row.cdzt != '0'">
          <el-table-column
            fixed="right"
            align="center"
            slot="operation"
            class-name="operationMore"
            label="操作"
            width="180">
            <template slot-scope="s">
              <el-button type="info" size="mini" @click="tableTemporary(s.row) " v-if="s.row.zbfh !=='0'">标记暂不发货</el-button>
              <el-button type="info" size="mini" @click="tableCancelTemporary(s.row)" v-if="s.row.zbfh !=='1'">取消暂不发货</el-button>
              <el-button type="success" icon="edit" size="mini"  v-if="dialogSearch.row.cdzt == '0'" @click="dialogMxOpen('put', s.row)"></el-button>
              <el-button type="danger" icon="delete" size="mini"  v-if="dialogSearch.row.cdzt == '0'" @click="tableSearchDelete(s.row)"></el-button>
            </template>
          </el-table-column>
        </s-table>
      </div>
      <!--<el-button slot="footer" type="warning" v-if="dialogSearch.row.shzt == '0'" @click="tableExamine(dialogSearch.row)">通过审核</el-button>-->
      <el-button slot="footer" @click="dialogSearchSave">好</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogUpload" :close="dialogUploadInit" :closeTip="false">
      <p slot="title">上传订单</p>
      <el-upload
        ref="upload"
        name="zxwms_shipment"
        :action="action"
        :before-upload="dialogUploadBefore"
        :on-success="dialogUploadSuccess"
        :auto-upload="false">
        <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
        <el-button style="margin-left: 10px;" size="small" type="success" @click="dialogUploadSubmit">上传到服务器</el-button>
        <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
      </el-upload>
      <el-button slot="footer" @click="dialogUploadSave">好</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogAllotDetailed" :close="dialogAllotDetailedInit" @http="tableWatch">
      <p slot="title">{{dialogAllotDetailed.title}}发运订单行 <span>{{dialogAllotDetailed.row.fybh}}</span></p>
      <s-table :table="tableAllotDetailed" ref="tableAllotDetailed" @http="tableWatch" :expand="false">
        <el-table-column
          fixed="right"
          align="center"
          slot="operation"
          class-name="operationMore"
          label="可用操作"
          width="120">
          <template slot-scope="s">
            <el-button type="info" size="mini" @click="dialogAllotDetailedMxOpen(s.row)">选择</el-button>
          </template>
        </el-table-column>
      </s-table>
    </s-dialog>
    <s-dialog :dialog="dialogAllotDetailedMx" :close="dialogAllotDetailedMxInit">
      <s-table :table="tableAllotDetailedMx" ref="tableAllotDetailedMx" @http="tableWatch">
      </s-table>
    </s-dialog>
    <s-dialog :dialog="dialogConfigure" :close="dialogConfigureInit">
      <p slot="title">{{dialog.title}}导入配置信息</p>
      <s-form :form="formDialogConfigure" ref="formDialogConfigure">
        <el-row>
          <el-col :xs="24" :lg="{span: 4, offset: 0}" class="">
            <el-form-item prop="bth" label="行号">
              <el-input
                type="text"
                v-model="formDialogConfigure.bth"
                placeholder="行号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="ckid" label="仓库Id">
              <el-input
                type="text"
                v-model="formDialogConfigure.ckid"
                placeholder="仓库id"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="ddrq" label="订单日期">
              <el-input
                type="text"
                v-model="formDialogConfigure.ddrq"
                placeholder="订单日期"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="ddsheng" label="订单所属省">
              <el-input
                type="text"
                v-model="formDialogConfigure.ddsheng"
                placeholder="订单所属省"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="ddshi" label="订单所属市">
              <el-input
                type="text"
                v-model="formDialogConfigure.ddshi"
                placeholder="订单所属市"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 4, offset: 0}" class="">
            <el-form-item prop="dh" label="单号">
              <el-input
                type="text"
                v-model="formDialogConfigure.dh"
                placeholder="单号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="fhrq" label="发货日期">
              <el-input
                type="text"
                v-model="formDialogConfigure.fhrq"
                placeholder="发货日期"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="ghdh" label="购货单号">
              <el-input
                type="text"
                v-model="formDialogConfigure.ghdh"
                placeholder="购货单号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="gxsj" label="更新时间">
              <el-input
                type="text"
                v-model="formDialogConfigure.gxsj"
                placeholder="更新时间"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="hpbh" label="货品编号">
              <el-input
                type="text"
                v-model="formDialogConfigure.hpbh"
                placeholder="货品编号"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 4, offset: 0}" class="">
            <el-form-item prop="hpdj" label="货品单价">
              <el-input
                type="text"
                v-model="formDialogConfigure.hpdj"
                placeholder="货品单价"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="hpdwmc" label="货品单位名称">
              <el-input
                type="text"
                v-model="formDialogConfigure.hpdwmc"
                placeholder="货品单位名称"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="hplsje" label="货品零售金额">
              <el-input
                type="text"
                v-model="formDialogConfigure.hplsje"
                placeholder="货品零售金额"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="hpsl" label="货品数量">
              <el-input
                type="text"
                v-model="formDialogConfigure.hpsl"
                placeholder="货品数量"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="khbh" label="客户编号">
              <el-input
                type="text"
                v-model="formDialogConfigure.khbh"
                placeholder="客户编号"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 4, offset: 0}" class="">
            <el-form-item prop="khmc" label="客户名称">
              <el-input
                type="text"
                v-model="formDialogConfigure.khmc"
                placeholder="客户名称"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="lx" label="发运单据类型">
              <el-input
                type="text"
                v-model="formDialogConfigure.lx"
                placeholder="发运单据类型"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="hplsje" label="货品零售金额">
              <el-input
                type="text"
                v-model="formDialogConfigure.hplsje"
                placeholder="货品零售金额"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="qzh" label="明细取值行号">
              <el-input
                type="text"
                v-model="formDialogConfigure.qzh"
                placeholder="明细取值开始行号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="shdz" label="收货地址">
              <el-input
                type="text"
                v-model="formDialogConfigure.shdz"
                placeholder="收货地址"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-for="(item, index) in x">
          <el-col :xs="24" :lg="{span: 4, offset: 0}" class="">
            <el-form-item :label="'收货人 ' + index">
              <el-input
                type="text"
                v-model="item.shr"
                placeholder="收货人"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item :label=" '收货人 电话 ' + index">
              <el-input
                type="text"
                v-model="item.shrdh"
                placeholder="收货人电话"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}" class="">
            <el-form-item prop="ssddqdid" label="订单渠道ID">
              <el-input
                type="text"
                v-model="formDialogConfigure.ssddqdid"
                placeholder="订单渠道ID"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </s-form>
      <el-button slot="footer" @click="dialogConfigureSave">保存</el-button>
      <el-button slot="footer" @click="dialogConfigureAdd">新增</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogBack" :close="dialogBackInit">
      <p slot="title">{{dialogBack.title}}关联退单</p>
      <s-table :table="tableBack" ref="tableBack" @http="tableWatch" :multiSelect="true"></s-table>
      <el-button slot="footer" type="success" @click="dialogBackSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogStock" :close="dialogStockInit">
      <p slot="title">{{dialogStock.title}}库存余量</p>
      <s-table :table="tableStock" ref="tableStock" @http="tableWatch" :expand="false"></s-table>
    </s-dialog>
    <s-dialog :dialog="dialogPackingDetailed" :close="dialogPackingDetailedInit">
      <p slot="title">{{dialogPackingDetailed.title}}装箱明细</p>
      <s-table :expand="false" :table="tablePackingDetailed" ref="tablePackingDetailed" @http="tableWatch">
        <el-table-column
          fixed="right"
          align="center"
          slot="operation"
          class-name="operationMore"
          label="可用操作"
          width="150">
          <template slot-scope="s">
            <el-button type="success" size="mini" @click="dialogPackingDetailedMxEditOpen(s.row)">编辑</el-button>
            <el-button type="info" size="mini" @click="dialogPackingDetailedMxOpen(s.row)">查看</el-button>
            <el-button type="info" size="mini" @click="dialogPackingDetailedPrint(s.row)" v-if="s.row.zslx === '整箱'"><i class="fa fa-print" aria-hidden="true"></i>打印</el-button>
          </template>
        </el-table-column>
      </s-table>
    </s-dialog>
    <s-dialog :dialog="dialogPackingDetailedMx" :close="dialogPackingDetailedMxInit">
      <s-table :table="tablePackingDetailedMx" ref="tablePackingDetailedMx" @http="tableWatch"></s-table>
    </s-dialog>
    <s-dialog :dialog="dialogUpload2" :close="dialogUploadInit2" :closeTip="false">
      <p slot="title">附件管理</p>
      <el-upload
        ref="upload2"
        name="zxwms_shipment"
        :action="action"
        :before-upload="dialogUploadBefore2"
        :on-success="dialogUploadSuccess2"
        :on-error="dialogUploadError2"
        :auto-upload="false">
        <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
        <el-button style="margin-left: 10px;" size="small" type="success" @click="dialogUploadSubmit2">上传到服务器</el-button>
        <!--<div slot="tip" class="el-upload__tip">只能上传Excel文件</div>-->
      </el-upload>
      <s-table :table="tableUpload2" ref="tableUpload2"  :expand="false" @http="tableWatch">
        <el-table-column
          fixed="right"
          align="center"
          slot="operation"
          class-name="operationMore"
          label="可用操作"
          width="125">
          <template slot-scope="s">
            <el-button type="info" size="mini" @click="downloadfile(s.row)">下载</el-button>
          </template>
        </el-table-column>
      </s-table>
      <el-button slot="footer" @click="dialogUploadSave2">好</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogPackingDetailedMxEdit" :close="dialogPackingDetailedMxEditInit">
      <s-form :form="formPackingDetailedMxEdit" ref="formPackingDetailedMxEdit">
        <el-row>
          <el-col :xs="24" :lg="{span: 11, offset: 0}">
            <el-form-item prop="xxh" label="箱序号">
              <el-input
                type="text"
                disabled
                v-model="formPackingDetailedMxEdit.xxh"
                placeholder="箱序号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 11, offset: 1}">
            <el-form-item prop="xbh" label="箱编号">
              <el-input
                type="text"
                disabled
                v-model="formPackingDetailedMxEdit.xbh"
                placeholder="箱编号"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 11, offset: 0}">
            <el-form-item prop="xx" label="箱型">
              <el-input
                type="text"
                disabled
                v-model="formPackingDetailedMxEdit.xx"
                placeholder="箱型"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 11, offset: 1}">
            <el-form-item prop="zzl" label="重量">
              <el-input
                type="text"
                disabled
                v-model="formPackingDetailedMxEdit.zzl"
                placeholder="重量"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 11, offset: 0}">
            <el-form-item prop="zslx" label="整散标记">
              <el-input
                type="text"
                disabled
                v-model="formPackingDetailedMxEdit.zslx"
                placeholder="整散标记"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 11, offset: 1}">
            <el-form-item prop="ysdh" label="物流单号">
              <el-input
                type="text"
                v-model="formPackingDetailedMxEdit.ysdh"
                placeholder="物流单号"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 11, offset: 0}">
            <el-form-item prop="yf" label="运费">
              <el-input
                type="text"
                v-model="formPackingDetailedMxEdit.yf"
                placeholder="运费"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 11, offset: 1}">
            <el-form-item prop="ysgs" label="物流公司">
              <el-input
                type="text"
                v-model="formPackingDetailedMxEdit.ysgs"
                placeholder="物流公司"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </s-form>
      <el-button slot="footer" @click="dialogPackingDetailedMxEditSave">保存</el-button>
    </s-dialog>
    <!--承运商-->
    <s-dialog :dialog="dialogCreate" :close="dialogCreateInit">
      <p slot="title">{{dialogCreate.title}}承运商类别</p>
      <s-form :form="formDialogCreate" ref="formDialogCreate">
        <el-row>
          <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
            <el-form-item prop="d_name" label="承运商类别">
              <el-select v-model="formDialogCreate.d_name"
                         filterable
                         remote
                         @change="dialogRemoteCyslbmcId"
                         placeholder="请选择承运商类别"
                         :remote-method="dialogRemoteCyslbmc">
                <el-option
                  v-for="item in dialogCreate.wmsshipmentorder"
                  :key="item.id"
                  :label="item.d_name"
                  :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <!--
          <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
            <el-form-item prop="cycl" label="承运车辆">
              <el-select v-model="formDialogCreate.cycl"
                         filterable
                         remote
                         @change="dialogRemoteCyclid"
                         :remote-method="dialogRemoteCycl"
                         placeholder="请选择承运车辆">
                <el-option
                  v-for="item in dialogCreate.searchCph"
                  :key="item.cyclid"
                  :label="item.cycl"
                  :value="item.cyclid">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          -->
        </el-row>
      </s-form>
      <el-button slot="footer" @click="dialogCreateSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogCys" :close="dialogCysInit">
      <p slot="title">{{dialogCys.title}}承运商类别</p>
      <s-form :form="formDialogCys" ref="formDialogCys">
        <el-row>
          <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
            <el-form-item prop="d_name" label="承运商类别">
              <el-select v-model="formDialogCys.d_name"
                         filterable
                         remote
                         @change="dialogRemoteCyslbmcId"
                         placeholder="请选择承运商类别"
                         :remote-method="dialogRemoteCyslbmc">
                <el-option
                  v-for="item in dialogCreate.wmsshipmentorder"
                  :key="item.id"
                  :label="item.d_name"
                  :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </s-form>
      <el-button slot="footer" @click="dialogCysSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogprint" :close="dialogprintInit">
      <el-card>
        <el-row>
          <el-col :span="8">
            <el-button  type="primary" @click="manyprint('')">多选打印</el-button>
          </el-col>
        </el-row>
      </el-card>
      <s-table :table="tableprint" ref="tableprint" :expand="false" @http="tableWatch">
        <el-form-item label="打印状态" prop="print">
          <el-select  class="input"
                      v-model="print"
                      @change="query"
                      placeholder="请选择"
                      auto-complete="off"
                      auto-correct="off">
            <el-option label="未打印" value="0">
            </el-option>
            <el-option label="已打印" value="1">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="发运编号" prop="fybh">
          <el-input type="text"
                    class="input"
                    v-model="autoVue_tableprint_fybh"
                    placeholder="发运编号" spellcheck="false" auto-capitalize="off" auto-complete="off"
                    auto-correct="off"></el-input>
        </el-form-item>
      </s-table>
    </s-dialog>
  </div>
</template>

<script>
  /* eslint-disable semi,one-var,comma-spacing */

  import {AutoVue, AutoPromise, FormatterTime, GetLodop} from '~/plugins/Tools';
  import Config from '~/config';
  let {
    PublicImageServer,
  } = Config;

  function __form1_kh () {
    return {
      khbh: { value: '', rule: [], cRemarks: '' },
      khmc: { value: '', rule: [], cRemarks: '' },
      khdz: { value: '', rule: [], cRemarks: '' },
      xlmc: { value: '', rule: [], cRemarks: '' },
      lxrxm: { value: '', rule: [], cRemarks: '' },
      lxrdh: { value: '', rule: [], cRemarks: '' },
    };
  }
  function __formCreate () {
    return {
      d_name: { value: '', rule: [ 'vNull__change' ] },
      d_vaule: { value: '', rule: [ 'vNull__change' ] },
      id: { value: '', rule: [ 'vNull__change' ] },
    };
  }
  function __formCys () {
    return {
      d_name: { value: '', rule: [ 'vNull__change' ] },
      d_vaule: { value: '', rule: [ 'vNull__change' ] },
      id: { value: '', rule: [ 'vNull__change' ] },
    };
  }
  function __formMulti () {
    return {
      d_name: { value: '', rule: [ 'vNull__change' ] },
      d_value: { value: '', rule: [ 'vNull__change' ] },
      id: { value: '', rule: [ 'vNull__change' ] },
    };
  }
  function __form1 () {
    return {
      khid: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      zyf: { value: '', rule: [ ], cRemarks: '' },
      khddh: { value: '', rule: [], cRemarks: '' },
      ...__form1_kh(),
      fybh: { value: '1', rule: [ 'vNull' ], cRemarks: '' },
      fylx: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      yxj:
        { value: 1,
          rule: [ 'vNull__change' ],
          cRemarks: '1、1， 2、2，3、3,4、4,5、5' },
      zdsh: { value: '', rule: [], cRemarks: '0、未审核 1、已审核' },
      bz: { value: '', rule: [ '' ], cRemarks: '' },
      cjsj: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      jhfhsj: { value: '', rule: [ 'vNull' ], cRemarks: '', type: 'Date' },
      yqjhsj: { value: '', rule: [ 'vNull' ], cRemarks: '', type: 'Date' },
      jhfs: { value: '0', rule: [ 'vNull__change' ], cRemarks: '0：发运 1：自提' },
    };
  }
  function __tableMx () {
    return {
      column: [
        { label: '货品编号',
          prop: 'bh',
          minWidth: '200px',
          cRemarks: '',
          search: false },
        { label: '货品名称',
          prop: 'mc',
          minWidth: '200px',
          cRemarks: '',
          search: false },
        { label: '包装名称',
          prop: 'bzmc',
          minWidth: '200px',
          cRemarks: '',
          search: false },
        { label: '主单位',
          prop: 'ms',
          minWidth: '200px',
          cRemarks: '',
          search: false },
        { label: '预期数量',
          prop: 'yqsl',
          minWidth: '200px',
          cRemarks: '',
          search: false },
        { label: '预期数量',
          prop: 'yqxdwsl',
          minWidth: '200px',
          cRemarks: '',
          search: false },
        { label: '分配数量',
          prop: 'fpsl',
          minWidth: '200px',
          cRemarks: '',
          search: false },
        { label: '拣货数量',
          prop: 'jhsl',
          minWidth: '200px',
          cRemarks: '',
          search: false },
        { label: '发运数量',
          prop: 'fysl',
          minWidth: '200px',
          cRemarks: '',
          search: false },
        { label: '库位名称',
          prop: 'kwmc',
          minWidth: '200px',
          cRemarks: '',
          search: false },
        { label: '批次号',
          prop: 'pc',
          minWidth: '200px',
          cRemarks: '',
          search: false },
        { label: '生产日期',
          prop: 'scrq',
          minWidth: '200px',
          formatter: (row, column) => {
            return FormatterTime(row[column.property || column], 3);
          },
          cRemarks: '',
          search: false },
        { label: 'SO状态',
          prop: 'show_fymxzt',
          minWidth: '200px',
          cRemarks: '0、初始 1、部分分配2、全部分配 3、部分发运4、全部发运5、订单取消6、订单完成',
          search: true },
        { label: '暂不发货',
          prop: 'show_zbfh',
          minWidth: '200px',
          cRemarks: '',
          search: false },
      ],
      key: 'id',
      tableColumn: 6,
    };
  }

  function __formDialogMx_goods () { // hpid
    return {
      mc: { value: '', rule: [], cRemarks: '' },
      bzmc: { value: '', rule: [], cRemarks: '' },
    };
  }
  function __formDialogMx_pack () {
    return {
      tj: { value: '', rule: [], cRemarks: '' },
      jz: { value: '', rule: [], cRemarks: '' },
      zl: { value: '', rule: [], cRemarks: '' },
      je: { value: '', rule: [], cRemarks: '' },
      zdwsl: { value: '', rule: [], cRemarks: '' },
    };
  }
  function __formDialogMx () {
    return {
      bh: { value: '', rule: ['vNull__change'], cRemarks: '' },
      ...__formDialogMx_goods(),
      ms: { value: '', rule: ['vNull__change', 'vNumberZ'], cRemarks: '' },
      ...__formDialogMx_pack(),
      yqsl: { value: '', rule: ['vNumber', 'vNull__change', 'vNumberZ'], cRemarks: '' },
      sum: { value: '0', rule: ['vNumber', 'vNumberZ'], cRemarks: '' },
      yqxdwsl: { value: '', rule: ['v_XiangYanZhen'], cRemarks: '' },
      kwid: { value: '', rule: [], cRemarks: '' },
      pc: { value: '', rule: [], cRemarks: '' },
      scrq: { value: '', rule: [], cRemarks: '' },
    };
  }
  function __formConfigure () {
    return {
      bth: { value: '', rule: ['vNull__change'], cRemarks: '表头行号' },
      ckid: { value: '', rule: ['vNull__change'], cRemarks: '仓库id' },
      ddrq: { value: '', rule: ['vNull__change'], cRemarks: '订单日期' },
      ddsheng: { value: '', rule: ['vNull__change'], cRemarks: '订单所属省' },
      ddshi: { value: '', rule: ['vNull__change'], cRemarks: '订单所属市' },
      dh: { value: '', rule: ['vNull__change'], cRemarks: '单号' },
      fhrq: { value: '', rule: ['vNull__change'], cRemarks: '发货日期' },
      ghdh: { value: '', rule: ['vNull__change'], cRemarks: '购货单号' },
      gxsj: { value: '', rule: ['vNull__change'], cRemarks: '更新时间' },
      hpbh: { value: '', rule: ['vNull__change'], cRemarks: '货品编号' },
      hpdj: { value: '', rule: ['vNull__change'], cRemarks: '货品单价' },
      hpdwmc: { value: '', rule: ['vNull__change'], cRemarks: '货品单位名称' },
      hplsje: { value: '', rule: ['vNull__change'], cRemarks: '货品零售金额' },
      hpsl: { value: '', rule: ['vNull__change'], cRemarks: '货品数量' },
      khbh: { value: '', rule: ['vNull__change'], cRemarks: '客户编号' },
      khmc: { value: '', rule: ['vNull__change'], cRemarks: '客户名称' },
      lx: { value: '', rule: ['vNull__change'], cRemarks: '发运单据类型' },
      qzh: { value: '', rule: ['vNull__change'], cRemarks: '明细取值开始行号' },
      shdz: { value: '', rule: ['vNull__change'], cRemarks: '收货地址' },
      shr1: { value: '', rule: ['vNull__change'], cRemarks: '收货人1' },
      shr1dh: { value: '', rule: ['vNull__change'], cRemarks: '收货人1电话' },
      shr2: { value: '', rule: ['vNull__change'], cRemarks: '收货人2' },
      shr2dh: { value: '', rule: ['vNull__change'], cRemarks: '收货人2电话' },
      ssddqdid: { value: '', rule: ['vNull__change'], cRemarks: '所属订单渠道ID' },
      sshzid: { value: '', rule: ['vNull__change'], cRemarks: '所属货主ID' },
    };
  }
  function __x () {
    return {
      shr: '',
      shrdh: '',
    };
  }

  function __formPackingDetailedMxEdit () {
    return {
      xbh: { value: '', rule: [], cRemarks: '箱编号' },
      xxh: { value: '', rule: [], cRemarks: '箱序号' },
      xx: { value: '', rule: [], cRemarks: '箱型' },
      zzl: { value: '', rule: [], cRemarks: '重量' },
      zslx: { value: '', rule: [], cRemarks: '整散标记' },
      ysdh: { value: '', rule: [], cRemarks: '物流单号' },
      yf: { value: '', rule: [], cRemarks: '运费' },
      ysgs: { value: '', rule: [], cRemarks: '物流公司' },
    };
  }
  export default AutoVue({
    name: 'outOperation_shipment-FEcarWms',
    head: {
      'title': '发运订单管理',
      'meta': [
        { 'hid': 'description', 'name': 'description', 'content': '乐速科技平台 发运订单 查看发运订单信息' },
      ],
    },
    store: ['DICTIONARY_shipment', 'SHIPMENT', 'USER', 'ORDERCHANNEL'],
    data: {
      dialogCreate: {
        wmsshipmentorder: [],
        row: {},
        title: '修改',
        cyslb: '',
      },
      formDialogCreate: __formCreate(),
      dialogCys: {
        wmsshipmentorder: [],
        row: {},
        title: '修改',
        cyslb: '',
        table: '',
      },
      formDialogCys: __formCys(),
      dialogMulti: {
        wmsloading: [],
        searchCph: [],
        row: {},
      },
      formDialogMulti: __formMulti(),
      dialogPackingDetailedMxEdit: {
        title: '编辑',
      },
      formPackingDetailedMxEdit: __formPackingDetailedMxEdit(),

      dialogUpload2: {
        title: '查看',
        size: 'large',
      },
      tableUpload2: {
        column: [
          {
            label: '附件名称',
            prop: 'name',
            minWidth: '0px',
            search: false,
          },
          {
            label: '链接地址',
            prop: 'url',
            minWidth: '0px',
            search: false,
          },
        ],
        data: [],
        key: 'id',
        tableColumn: 2,
        muti: false,
      },
      jsonpoid: '',
      x: [
      ],
      tree: {
        data: [],
      },
      table: {
        column: [
          { label: 'SO编号',
            prop: 'fybh',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '客户订单号',
            prop: 'khddh',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: 'SO类型',
            prop: 'show_fylx',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '客户编号',
            prop: 'khbh',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '客户名称',
            prop: 'khmc',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '打印箱标签状态',
            prop: 'show_print',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '联系人',
            prop: 'lxrxm',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '批次状态',
            prop: 'show_dpczt',
            minWidth: '200px',
            elTag: {
              filterType: function (value) {
                return value === '多批次' ? 'danger' : 'success';
              },
            },
            cRemarks: '',
            search: false },
          { label: '路线',
            prop: 'xl',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '波次编号',
            prop: 'bcbh',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '货品编号',
            prop: 'hpbh',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '货品名称',
            prop: 'hpmc',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '优先级',
            prop: 'yxj',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '客户地址',
            prop: 'khdz',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '审核状态',
            prop: 'show_shzt',
            minWidth: '200px',
            cRemarks: '0、未审核 1、已审核',
            search: true },
          { label: '拆单状态',
            prop: 'show_cdzt',
            minWidth: '200px',
            cRemarks: '0、未拆单 1、已拆单',
            search: true },
          { label: '总运费',
            prop: 'zyf',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '关联单号',
            prop: 'gldh',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '交货方式',
            prop: 'show_jhfs',
            minWidth: '200px',
            cRemarks: '0、发运 1、自提',
            search: true },
          { label: '装箱状态',
            prop: 'show_zxzt',
            minWidth: '200px',
            cRemarks: '0、未装箱 1、部分装箱 2、全部装箱',
            search: true },
          { label: '波次状态',
            prop: 'show_bczt',
            minWidth: '200px',
            cRemarks: '0、未加入 1、已加入',
            search: true },
          { label: '拣货状态',
            prop: 'show_jhzt',
            minWidth: '200px',
            cRemarks: '0、初始 1、部分拣货 2、全部拣货',
            search: true },
          { label: '拣货任务状态',
            prop: 'show_jhrwzt',
            minWidth: '200px',
            cRemarks: '0、初始 1、部分拣货 2、全部拣货',
            search: true },
          { label: 'SO状态',
            prop: 'show_fyzt',
            minWidth: '200px',
            cRemarks: '0、初始 1、部分分配2、全部分配 3、部分发运4、全部发运5、订单取消6、订单完成',
            search: true },
          { label: '备注',
            prop: 'bz',
            minWidth: '200px',
            cRemarks: '',
            search: false },
          { label: '计划发货时间',
            prop: 'jhfhsj',
            minWidth: '200px',
            cRemarks: '',
            formatter: (row, column) => {
              return this.a.methods.formatterTime(row[column.property || column], 6);
            },
            type: 'DateRange',
            search: true },
          { label: '要求交货时间',
            prop: 'yqjhsj',
            minWidth: '200px',
            cRemarks: '',
            formatter: (row, column) => {
              return this.a.methods.formatterTime(row[column.property || column], 6);
            },
            type: 'DateRange',
            search: true },
          { label: '客户创建时间',
            prop: 'khcjsj',
            minWidth: '200px',
            cRemarks: '',
            formatter: (row, column) => {
              return this.a.methods.formatterTime(row[column.property || column], 6);
            },
            type: 'DateRange',
            search: true },
          { label: 'wms创建时间',
            prop: 'cjsj',
            minWidth: '200px',
            cRemarks: '',
            formatter: (row, column) => {
              return this.a.methods.formatterTime(row[column.property || column], 6);
            },
            type: 'DateRange',
            search: true },
          { label: '承运商类别',
            prop: 'show_cyslb',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '发起部门',
            prop: 'fqbm',
            minWidth: '200px',
            cRemarks: '',
            search: false },
          { label: '发起人',
            prop: 'fqr',
            minWidth: '200px',
            cRemarks: '',
            search: false },
          { label: '会员编号',
            prop: 'hybh',
            minWidth: '200px',
            cRemarks: '',
            search: false },
          { label: '退单状态',
            prop: 'show_tdzt',
            minWidth: '200px',
            cRemarks: '',
            search: false },
          { label: '客户等级',
            prop: 'khdj',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '退货状态',
            prop: 'show_thzt',
            minWidth: '200px',
            cRemarks: '',
            search: false },
        ],
        url: '/wmsshipmentorder/list',
        key: 'id',
        muti: false,
        popover: {
          width: 1100,
        },
        autoColumnClose: true,
        tableColumn: 9,
        rowclass: true, // 控制row样式
      },

      dialog: {
        title: '新增',
        row: {},
        id: [],
        activeName: '1',
        activeNameCollapse: '1',
        wmsPurchaseOrder: [],
        wmsshipmentorder: [],
        hpbh: [],
        size: 'large',
        orderChannel: true,
        both: false,
        sheng: '',
        shi: '',
        khdz: '',
        lxrdh: '',
        lxrxm: '',
      },
      formDialog1: __form1(),
      tableMx: __tableMx(),

      dialogMx: {
        title: '新增',
        size: 'large',
        row: {},
        hpid: [],
        pack: [],
        packValue: {
          bzlx: '0',
        },
        data: {},
        step: {},
        sum: 0,

        pcid: [],
        rqid: [],
        kwid: [],

        kwData: {},
      },
      formDialogMx: __formDialogMx(),

      dialogSearch: {
        size: 'large',
        row: {},
      },
      tableSearch: __tableMx(),

      dialogSplitSingleDetailed: {
        title: '查看',
      },
      tableSplitSingleDetailed: {
        column: [
          { label: '货品编号',
            prop: 'bh',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '货品名称',
            prop: 'mc',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '包装名称',
            prop: 'bzmc',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '主单位数量',
            prop: 'yqsl',
            minWidth: '0px',
            cRemarks: '',
            search: false },
        ],
        mitl: false,
        url: '/wmsdistribution/searchDetailed',
        tableColumn: 4,
        option: {
          id: '',
        },
      },

      dialogSplitSingleDetailedMx: {
        title: '查看',
      },
      tableSplitSingleDetailedMx: {
        column: [
          { label: '货品编号',
            prop: 'hpbh',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '货品名称',
            prop: 'hpmc',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '主单位数量',
            prop: 'zdwsl',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '整散标记',
            prop: 'show_zsbj',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '单位类型',
            prop: 'dwlx',
            minWidth: '0px',
            cRemarks: '',
            search: false },
        ],
        mitl: false,
        url: '/wmsSplit/list',
        tableColumn: 4,
        option: {
          ssfymxid: '',
        },
      },

      dialogUpload: {},

      dialogAllotDetailed: {
        title: '查看',
        row: {},
        size: 'large',
      },
      tableAllotDetailed: {
        column: [
          { label: '明细状态',
            prop: 'show_fymxzt',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '货品名称',
            prop: 'bh',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '货品名称',
            prop: 'mc',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '包装名称',
            prop: 'bzmc',
            minWidth: '0',
            cRemarks: '',
            search: false },
          { label: '主单位数量',
            prop: 'fpsl',
            minWidth: '100px',
            cRemarks: '',
            search: false },
        ],
        option: {
          id: '',
        },
        tableColumn: 5,
        url: '/wmsdistribution/searchDetailed',
        key: 'id',
        muti: false,
      },

      dialogAllotDetailedMx: {
        title: '查看',
        row: {},
        size: 'large',
      },
      tableAllotDetailedMx: {
        column: [
          { label: '货品编号',
            prop: 'bh',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '货品名称',
            prop: 'mc',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '分配数量',
            prop: 'fpsl',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '库位名称',
            prop: 'show_kwid',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '货品批次',
            prop: 'hppc',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '生产日期',
            prop: 'scrq',
            minWidth: '0px',
            type: 'DateRange',
            cRemarks: '',
            formatter: (row, column) => {
              return this.a.methods.formatterTime(row[column.property || column], 6);
            },
            search: true },
          { label: '失效日期',
            prop: 'sxrq',
            minWidth: '0px',
            type: 'DateRange',
            cRemarks: '',
            formatter: (row, column) => {
              return this.a.methods.formatterTime(row[column.property || column], 6);
            },
            search: true },
          { label: '分配序号',
            prop: 'fpxh',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '装箱状态',
            prop: 'show_zxzt',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '拣货人',
            prop: 'jhr',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '拣货时间',
            prop: 'jhsj',
            minWidth: '0px',
            type: 'DateRange',
            cRemarks: '',
            formatter: (row, column) => {
              return this.a.methods.formatterTime(row[column.property || column], 6);
            },
            search: true },
          { label: '集货库位',
            prop: 'show_jhkwid',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '发运状态',
            prop: 'show_fyzt',
            minWidth: '0px',
            cRemarks: '',
            search: false },
        ],
        tableColumn: 5,
        url: '/wmsdistribution/distributionDetailed',
        key: 'id',
        muti: false,
        option: {
          id: '',
        },
      },

      dialogConfigure: {
      },
      formDialogConfigure: __formConfigure(),

      dialogBack: {
        title: '查看',
        size: 'large',
        row: {},
      },
      tableBack: {
        column: [
          { label: 'SO编号',
            prop: 'fybh',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '客户订单号',
            prop: 'khddh',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: 'SO类型',
            prop: 'show_fylx',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '客户编号',
            prop: 'khbh',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '客户名称',
            prop: 'khmc',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '联系人',
            prop: 'lxrxm',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '路线',
            prop: 'xl',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '波次编号',
            prop: 'bcbh',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '货品编号',
            prop: 'bh',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '货品名称',
            prop: 'hpmc',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '优先级',
            prop: 'yxj',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '客户地址',
            prop: 'khdz',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '审核状态',
            prop: 'show_shzt',
            minWidth: '0px',
            cRemarks: '0、未审核 1、已审核',
            search: true },
          { label: '拆单状态',
            prop: 'show_cdzt',
            minWidth: '0px',
            cRemarks: '0、未拆单 1、已拆单',
            search: true },
          { label: '交货方式',
            prop: 'show_jhfs',
            minWidth: '0px',
            cRemarks: '0、发运 1、自提',
            search: true },
          { label: '装箱状态',
            prop: 'show_zxzt',
            minWidth: '0px',
            cRemarks: '0、未装箱 1、部分装箱 2、全部装箱',
            search: true },
          { label: '波次状态',
            prop: 'show_bczt',
            minWidth: '0px',
            cRemarks: '0、未加入 1、已加入',
            search: true },
          { label: '拣货状态',
            prop: 'show_jhzt',
            minWidth: '0px',
            cRemarks: '0、初始 1、部分拣货 2、全部拣货',
            search: true },
          { label: 'SO状态',
            prop: 'show_fyzt',
            minWidth: '0px',
            cRemarks: '0、初始 1、部分分配2、全部分配 3、部分发运4、全部发运5、订单取消6、订单完成',
            search: true },
          { label: '备注',
            prop: 'bz',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '计划发货时间',
            prop: 'jhfhsj',
            minWidth: '0px',
            cRemarks: '',
            formatter: (row, column) => {
              return this.a.methods.formatterTime(row[column.property || column], 6);
            },
            type: 'DateRange',
            search: true },
          { label: '要求交货时间',
            prop: 'yqjhsj',
            minWidth: '0px',
            cRemarks: '',
            formatter: (row, column) => {
              return this.a.methods.formatterTime(row[column.property || column], 6);
            },
            type: 'DateRange',
            search: true },
          { label: '客户创建时间',
            prop: 'khcjsj',
            minWidth: '0px',
            cRemarks: '',
            formatter: (row, column) => {
              return this.a.methods.formatterTime(row[column.property || column], 6);
            },
            type: 'DateRange',
            search: true },
          { label: 'wms创建时间',
            prop: 'cjsj',
            minWidth: '0px',
            cRemarks: '',
            formatter: (row, column) => {
              return this.a.methods.formatterTime(row[column.property || column], 6);
            },
            type: 'DateRange',
            search: true },
          { label: '承运商类别',
            prop: 'show_cyslb',
            minWidth: '0px',
            cRemarks: '',
            search: true },
        ],
        url: '/wmsSplit/getSoList',
        key: 'id',
        muti: false,
        popover: {
          width: 900,
        },
        autoColumnClose: true,
        tableColumn: 6,
      },
      dialogStock: {
        title: '查看',
        size: 'large',
      },
      tableStock: {
        column: [
          { label: '货品编号',
            prop: 'hpbh',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '货品名称',
            prop: 'hpmc',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '预期数量',
            prop: 'yqsl',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '存储区库存数量',
            prop: 'ccqsl',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '拣货区库存数量',
            prop: 'jhqsl',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '暂存区库存数量',
            prop: 'zcqsl',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '库存总量',
            prop: 'total',
            minWidth: '0px',
            cRemarks: '',
            search: true },
        ],
        option: {
          ddid: '',
        },
        key: 'id',
        tableColumn: 7,
        url: '/wmsshipmentorder/getStockYl',
      },
      dialogPackingDetailed: {
        title: '查看',
        size: 'large',
      },
      tablePackingDetailed: {
        column: [
          { label: '箱序号',
            prop: 'xxh',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '箱编号',
            prop: 'xbh',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '箱型',
            prop: 'xx',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '重量',
            prop: 'zzl',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '整散标记',
            prop: 'zslx',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '物流单号',
            prop: 'ysdh',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '运费',
            prop: 'yf',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '物流公司',
            prop: 'ysgs',
            minWidth: '0px',
            cRemarks: '',
            search: true },
        ],
        url: '/wmsbox/selectZxmx',
        key: 'id',
        option: {
          ssfydid: '',
        },
        tableColumn: 8,
      },
      dialogPackingDetailedMx: {
        title: '查看',
      },
      tablePackingDetailedMx: {
        column: [
          { label: '货品名称',
            prop: 'goodsMc',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '货品编号',
            prop: 'goodsBh',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '货品数量',
            prop: 'sl',
            minWidth: '0px',
            cRemarks: '',
            search: true },
        ],
        url: '/wmsbox/selectZxmx',
        key: 'id',
        option: {
          ssfydid: '',
          xbh: '',
        },
        tableColumn: 3,
      },
      exporttype: '',
      tableprint: {
        column: [
          { label: 'SO编号',
            prop: 'fybh',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '客户名称',
            prop: 'cjr',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '承运商类别',
            prop: 'show_cyslb',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '客户订单号',
            prop: 'khddh',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '客户地址',
            prop: 'khdz',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: 'SO类型',
            prop: 'erji',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '省',
            prop: 'sheng',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '市',
            prop: 'shi',
            minWidth: '200px',
            cRemarks: '',
            search: true },
          { label: '联系人',
            prop: 'lxrxm',
            minWidth: '200px',
            cRemarks: '',
            search: true },
        ],
        url: '/wmsshipmentorder/selectPrintOrder',
        key: 'id',
        tableColumn: 9,
        option: {
          print: '',
        },
        // muti: false,
      },
      print: '',
      dialogprint: {
      },
    },
    transition: 'slide-fade',
    methods: {
      async query () {
        this.tableprint.option.print = this.print;
        this.tableWatch('tableprint');
        this.tableprint.option.print = '';
        if (this.tableprint.option.rows >= 1 || this.tableprint.option.page >= 1) {
          this.tableprint.option.print = this.print;
        }
        console.log(111111111, this.tableprint.option.print);
      },
      //  批量打印快递面单
      dialogprintInit () {},
      dialogprintOpen () {
        this.tableWatch('tableprint');
        this.dialogprint.visible = true;
      },
      // 确认打印快递面单
      manyprint: async function (row) {
        // 获取Ids
        let ids = [];
        if (row) {
          ids.push(row.id)
        } else {
          if (this.tableprint.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.tableprint.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将批量打印快递面单', '确认打印？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        }).then(async _ => {
          try {
            let urlData = await this.post('/wmsreview/zxPrintByFyIds', {
              ids,
            })
            // contentList后台返回的数据
            let contentList = urlData.data;
            console.log('contentList', contentList);
            if (contentList.length !== 0) {
              // 先调用方法
              let LODOP = GetLodop()
              // 打印名称
              // LODOP.PRINT_INIT('打印快递面单')
              for (let item of contentList) {
                console.log(item);
                /* NewPage意思新的一页 如果多个数据放到for里面必须写 */
                LODOP.NewPage();
                // ADD_PRINT_URL 设置参数 item 最后的item是你打印的地址
                LODOP.ADD_PRINT_URL(0, 0, 746, '100%', item)
                LODOP.SET_PRINT_STYLEA(0, 'HOrient', 3)
                LODOP.SET_PRINT_STYLEA(0, 'VOrient', 3)
              }
              LODOP.PREVIEW()
            }
            this.tableWatch('tableprint');
          } catch (err) {
            console.log(err);
          }
        });
        // this.tableprint.multipleSelection.length = 0;
      },
      // 导出
      tableExport () {
        let tableRef = 'table';
        let ids = [];
        this.table.multipleSelection.forEach(item => {
          ids.push(item.id);
        });
        this.$confirm('您将导出发运订单的信息', '确认导出？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              let option = Object.assign({}, this['autoVue_' + tableRef]);
              await this.p({
                url: '/wmsFaYunOrderMx/getOutFaYunOrderList',
                method: 'post',
                responseType: 'blob',
                data: {
                  ids,
                  ...option,
                },
              });
            } catch (err) {
              console.log(err);
            }
          })
      },
      // 打印快递面单方法传入
      Printing: async function (row) {
        try {
          // 获取Ids
          let ids = []
          if (row) {
            ids.push(row.id)
          }
          let urlData = await this.post('/wmsreview/zxPrintByFyIds', {
            ids,
          })
          // contentList后台返回的数据
          let contentList = urlData.data;
          console.log('contentList', contentList);
          if (contentList.length !== 0) {
            // 先调用方法
            let LODOP = GetLodop()
            // 打印名称
            // LODOP.PRINT_INIT('打印快递面单')
            for (let item of contentList) {
              /* NewPage意思新的一页 如果多个数据放到for里面必须写 */
              LODOP.NewPage()
              // ADD_PRINT_URL 设置参数 item 最后的item是你打印的地址
              LODOP.ADD_PRINT_URL(0, 0, 746, '100%', item)
              LODOP.SET_PRINT_STYLEA(0, 'HOrient', 3)
              LODOP.SET_PRINT_STYLEA(0, 'VOrient', 3)
            }
            LODOP.PREVIEW()
          }
        } catch (err) {
        }
      },
      tableTemporary (row) {
        this.$confirm('您将选择的订单明细进行标记暂不发货', '确认标记？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsshipmentorder/updateZbfh', {
                id: row.id, zbfh: '0',
              });
              this.tableWatch('table');
              this.dialogSearch.visible = false;
            } catch (err) {
              console.log(err);
            }
          });
      },
      tableCancelTemporary (row) {
        this.$confirm('您将选择的订单明细进行取消标记暂不发货', '确认取消标记？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsshipmentorder/updateZbfh', {
                id: row.id, zbfh: '1',
              });
              this.tableWatch('table');
              this.dialogSearch.visible = false;
            } catch (err) {
              console.log(err);
            }
          });
      },
      dialogPackingDetailedMxEditInit () {
        this.formDialogPackingDetailedMxEdit = {
          ...this.formDialogPackingDetailedMxEdit,
          ...this.ObjectClone(__formPackingDetailedMxEdit()),
        };
        this.resetFields('PackingDetailedMxEdit');
      },
      dialogPackingDetailedMxEditOpen (row) {
        this.formPackingDetailedMxEdit = {
          ...this.formPackingDetailedMxEdit,
          ...this.ObjectClone(__formPackingDetailedMxEdit(), row),
        };
        this.dialogPackingDetailedMxEdit.row = row;
        this.dialogPackingDetailedMxEdit.visible = true;
      },
      async dialogPackingDetailedMxEditSave () {
        this.VALIDATE('formPackingDetailedMxEdit', async option => {
          try {
            await this.post('/wmsbox/fillInExpressSingleNumber', option);
            this.tableWatch('tablePackingDetailed');
            this.dialogPackingDetailedMxEditInit();
            this.dialogPackingDetailedMxEdit.visible = false;
          } catch (err) {
            console.log(err);
          };
        });
      },
      dialogPackingDetailedInit () {},
      dialogPackingDetailedOpen (row) {
        this.tablePackingDetailed.url = '/wmsbox/selectZxmx';
        this.tablePackingDetailed.option.ssfydid = row.id;
        this.tableWatch('tablePackingDetailed');
        this.dialogPackingDetailed.visible = true;
      },
      dialogPackingDetailedMxInit () {},
      dialogPackingDetailedMxOpen (row) {
        this.tablePackingDetailedMx.url = '/wmsbox/seachYxmx';
        this.tablePackingDetailedMx.option.ssfydid = this.tablePackingDetailed.option.ssfydid;
        this.tablePackingDetailedMx.option.xbh = row.xbh;
        this.tableWatch('tablePackingDetailedMx');
        this.dialogPackingDetailedMx.visible = true;
      },
      // 单条订单信息快递面单打印
      dialogPackingDetailedPrint: async function (row) {
        try {
          // 获取Ids
          let ids = []
          if (row) {
            ids.push(row.id)
          }
          console.log('ids', ids);
          let urlData = await this.post('/wmsreview/zxPrintByXids', {
            ids,
          })
          // contentList后台返回的数据
          let contentList = urlData.data;
          if (contentList.length !== 0) {
            for (let item of contentList) {
              console.log('itme', item);
              // 先调用方法
              let LODOP = GetLodop()
              // 打印名称
              LODOP.PRINT_INIT('打印快递面单')
              /* NewPage意思新的一页 如果多个数据放到for里面必须写 */
              LODOP.NewPage()
              // ADD_PRINT_URL 设置参数 item 最后的item是你打印的地址
              LODOP.ADD_PRINT_URL(0, 0, 746, '100%', item)
              LODOP.SET_PRINT_STYLEA(0, 'HOrient', 3)
              LODOP.SET_PRINT_STYLEA(0, 'VOrient', 3)
              LODOP.PREVIEW()
            }
          }
        } catch (err) {
        }
      },
      dialogStockInit () {},
      dialogStockOpen (row) {
        this.dialogStock.row = row;
        this.tableStock.url = '/wmsshipmentorder/getStockYl';
        this.tableStock.option.ddid = row.id;
        this.tableWatch('tableStock');
        this.dialogStock.visible = true;
      },
      tablecopyBillList (row) {
        this.$confirm('您将选择的发运订单进行复制订单的操作', '确认复制订单？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsshipmentorder/copyOrder', {
                id: row.id,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      tableEdit (row) {},
      tableDelete (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将作废选择的发运订单', '确认作废？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsshipmentorder/updateSfyx', {
                ids,
              });
              ids = [];
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      tableDeductible (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将选择的发运订单进行抵扣审核的操作', '确认抵扣审核？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsloading/deductible', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      tableBorrow (row) {
        this.$confirm('您将选择的发运订单进行借货完结的操作', '确认借货完结？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsshipmentorder/updateJhwjzt', {
                'id': row.id,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      dialogBackInit () {
        this.tableClear('tableBack');
      },
      dialogBackOpen (row) {
        this.dialogBack.row = row;
        console.log('id:' + row.id);
        if (row.fyzt === '3' || row.fyzt === '4') {
          this.$confirm('您将选择的发运订单进行退单的操作', '确认退单？', {
            confirmButtonText: '是',
            cancelButtonText: '否',
            type: 'warning',
          })
            .then(async _ => {
              try {
                await this.post('/wmsSplit/setTdzt', {id: row.id});
                this.tableWatch('table');
              } catch (err) {
                console.log(err);
              }
            });
        } else if (row.fyzt === '0') {
          this.tableWatch('tableBack');
          this.dialogBack.visible = true;
        }
      },
      async dialogBackSave () {
        let ids = [];
        if (this.tableBack.multipleSelection.length < 1) {
          await this.post('/wmsSplit/setTdzt', {
            'id': this.dialogBack.row.id,
          });
          this.tableWatch('tableBack');
          this.dialogBackInit();
          this.dialogBack.visible = false;
        } else {
          this.tableBack.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
          await this.post('/wmsSplit/setTdzt', {
            'id': this.dialogBack.row.id,
            ids,
          });
          this.tableWatch('tableBack');
          this.dialogBackInit();
          this.dialogBack.visible = false;
        }
      },
      tableExamine (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将审核选择的发运订单', '确认审核？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsshipmentorder/updateShzt', {
                ids,
              });
              this.tableWatch('table');
              this.dialogSearch.visible = false;
            } catch (err) {
              console.log(err);
            }
          });
      },
      tableBackList (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将选择的发运订单进行退单的操作', '确认退单？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsSplit/setTd ', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      tableComplete (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将标记选择的发运订单', '确认标记？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsshipmentorder/updateZt', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      tableCreate (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将选择的发运订单进行创建波次的操作', '确认创建波次？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmswave/add', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      tableRemove (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将选择的发运订单进行订单拆单的操作', '确认订单拆单？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsSplit/split', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      tableCancel (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将选择的发运订单进行取消拆单的操作', '确认取消拆单？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsSplit/cancel', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      tableAllot (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将分配选择的发运订单', '确认分配？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsdistribution/distribution', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      tableAdditionalAllot (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将追加分配选择的发运订单', '确认追加分配？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsdistribution/addDistribution', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      tableCancelAllot (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将取消分配选择的发运订单', '确认取消分配？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsdistribution/cancelDistribution', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      tablePacking (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将选择的发运订单进行装箱的操作', '确认装箱？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsbox/boxZx', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      tablePicking (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将选择的发运订单进行拣货操作', '确认拣货？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmspicking/pick', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      tableCancelPacking (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将选择的发运订单进行取消装箱的操作', '确认取消装箱？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsbox/cancelBoxZx', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      tableAdditionalPacking (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将选择的发运订单进行追加装箱的操作', '确认追加装箱？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsbox/againBoxZx', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          });
      },
      dialogSplitSingleDetailedOpen (row) {
        if (this.dialogSplitSingleDetailed.title === '查看') {
          this.tableSplitSingleDetailed.url = '/wmsdistribution/searchDetailed';
          this.tableSplitSingleDetailed.option.id = row.id;
          this.tableWatch('tableSplitSingleDetailed');
          this.dialogSplitSingleDetailed.visible = true;
        }
      },
      dialogSplitSingleDetailedMxOpen (row) {
        if (this.dialogSplitSingleDetailedMx.title === '查看') {
          this.tableSplitSingleDetailedMx.url = '/wmsSplit/list';
          this.tableSplitSingleDetailedMx.option.ssfymxid = row.id;
          this.tableWatch('tableSplitSingleDetailedMx');
          this.dialogSplitSingleDetailedMx.visible = true;
        }
      },

      dialogInit () {
        this.dialog.activeName = '1';
        this.dialog.activeNameCollapse = '1';
        this.formDialog1 = {
          ...this.formDialog1,
          ...this.ObjectClone(__form1()),
        };
        this.resetFields('formDialog1');
        this.tableClear('tableMx');
      },
      async dialogOpen (type, more) {
        if (type) {
          type = type.toUpperCase();
        } else return;
        switch (type) {
        case 'ADD':
          await AutoPromise([
            async () => {
              if (!this.DICTIONARY_shipment) {
                await this.USE('DICTIONARY_shipment');
              }
            },
            async () => {
              await this.dialogRemoteDdlx('');
            },
            async () => {
              await this.dialogRemoteKhbh('');
            },
            async () => {
              let {bh} = await this.get('/wmsshipmentorder/getBh');
              this.formDialog1.fybh = bh;
            },
          ]);
          this.resetFields('formDialog1');
          this.tableClear('tableMx');
          this.dialog.title = '新增';
          break;
        case 'PUT':
          this.dialog.row = more;
          await AutoPromise([
            async () => {
              if (!this.DICTIONARY_shipment) {
                await this.USE('DICTIONARY_shipment');
              }
            },
            async () => {
              await this.dialogRemoteDdlx('');
            },
            async () => {
              await this.dialogRemoteKhbh('');
            },
            async () => {
              let {bh} = await this.get('/wmsshipmentorder/getBh');
              this.formDialog1.fybh = bh;
            },
          ]);
          this.dialog.title = '修改';
          this.formDialog1 = {
            ...this.formDialog1,
            ...this.ObjectClone(__form1(), more),
          };
          this.dialog.row = more;
          this.dialogRemoteLx(more.fylx);
        }
        this.dialog.visible = true;
      },
      dialogPre () {
        this.dialog.activeName = parseInt(this.dialog.activeName) - 1 + '';
      },
      async dialogNext () {
        switch (this.dialog.activeName) {
        case '2':
          if (this.tableMx.data.length !== 0) {
            this.dialog.activeName = '3';
          } else {
            this.$alert('货品列表信息不能为空!', '提示');
          }
          break;
        default :this.VALIDATE('formDialog' + this.dialog.activeName, option => {
          this.dialog.activeName = parseInt(this.dialog.activeName) + 1 + '';
        });
          /*
        case '2':
          if (this.tableMx.data.length === 0) {
            this.dialog.activeName = parseInt(this.dialog.activeName) + 2 + '';
            break;
            // return this.$alert('货品列表信息不能为空!', '提示');
          }
          */
          /*
        default :this.VALIDATE('formDialog' + this.dialog.activeName, option => {
          this.dialog.activeName = parseInt(this.dialog.activeName) + 1 + '';
        });
        */
        }
      },
      tableMxDelete (index) {
        this.$confirm('您将删除该条明细。', '确认删除？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(() => {
            this.tableMx.data.splice(index, 1);
          });
      },
      dialogSave () {
        if (this.dialog.title === '新增') {
          this.VALIDATE('formDialog1', async option => {
            let kh = __form1_kh();
            for (let index in kh) {
              if (kh.hasOwnProperty(index)) {
                delete option[index];
              }
            }
            option.khdz = this.formDialog1.khdz;
            option.sheng = this.dialog.sheng;
            option.shi = this.dialog.shi;
            option.khdz = this.dialog.khdz;
            option.lxrdh = this.dialog.lxrdh;
            option.lxrxm = this.dialog.lxrxm;
            delete option.zdsh;
            let json = {
              ...option,
              wsodList: this.tableMx.data,
            };
            try {
              option = this.tree.select;
              json.ddqdid = option.id;
              if (option.id === '0') {
                delete json.ddqdid;
              }
              await this.post('/wmsshipmentorder/add', json);
              this.dialogInit();
              this.tableWatch('table');
              this.dialog.visible = false;
            } catch (err) {
              console.log(err);
            }
          });
        } else {
          this.VALIDATE('formDialog1', async option => {
            try {
              option.id = this.dialog.row.id;
              option.ssfyddid = this.dialogSearch.row.id;
              await this.post('/wmsshipmentorder/edit', option);
              this.dialogInit();
              this.tableWatch('table');
              this.dialog.visible = false;
            } catch (err) {
              console.log(err);
            }
          });
        }
      },

      dialogMxInit () {
        this.dialogMx.row = {};
        this.dialogMx.step = {};
        this.dialogMx.packValue = {
          bzlx: '0',
        };
        this.dialogMx.data = {};
        // this.dialogMx.hpid = [];
        this.dialogMx.pack = [];
        this.dialogMx.pcid = [];
        this.dialogMx.rqid = [];
        this.dialogMx.kwid = [];
        this.formDialogMx = {
          ...this.formDialogMx,
          ...this.ObjectClone(__formDialogMx()),
        };
        this.resetFields('formDialogMx');
        this.dialogMx.title = '新增';
      },
      async dialogMxOpen (type, row) {
        this.dialogMxRemoteBh();
        if (type) {
          type = type.toUpperCase();
        } else return;
        // await AutoPromise([
        //   async () => {
        //     this.dialogMxRemoteBh('');
        //   },
        // ]);
        switch (type) {
        case 'ADD':
          this.dialogMx.title = '新增';
          // this.dialogRemoteKwmc('');
          this.formDialogMx.bz = '';
          break;
        case 'PUT':
          this.dialogMx.title = '修改';
          this.dialogMx.row = row;
          this.dialogMx.step = Object.assign({}, row);
          this.dialogRemoteKwmc(row.kwmc);
          if (!this.$refs.formDialogMx) {
            // alert('if');
            setTimeout(() => {
              let unwatch = this.$watch('dialogMx.pack', () => {
                unwatch();
                if (this.dialogMx.pack.length > 1) {
                  let unwatch2 = this.$watch('formDialogMx.ms', () => {
                    unwatch2();
                    let unwatch3 = this.$watch('formDialogMx.sum', () => {
                      unwatch3();
                      this.formDialogMx.sum = this.dialogMx.step.je || 0;
                    });
                    this.formDialogMx.yqsl = this.dialogMx.step.yqsl || 0;
                    this.formDialogMx.yqxdwsl = this.dialogMx.step.yqxdwsl || '';
                    alert('11111', this.dialogMx.step.yqxdwsl);
                    console.log('this.formDialogMx.yqsl', this.formDialogMx.yqsl);
                    this.dialogRemotePch(row.pc);
                    this.dialogRemoteScrq(this.formatterTime(row.scrq));
                    this.formDialogMx.pc = this.dialogMx.step.pc || '';
                    this.formDialogMx.scrq = this.dialogMx.step.scrq || '';
                  });
                  this.formDialogMx.ms = this.dialogMx.step.ms;
                }
              });
              this.formDialogMx = {
                ...this.formDialogMx,
                ...this.ObjectClone(__formDialogMx(), row),
              };
            }, 250);
          } else {
            // alert('else');
            let unwatch = this.$watch('dialogMx.pack', () => {
              unwatch();
              if (this.dialogMx.pack.length > 1) {
                let unwatch2 = this.$watch('formDialogMx.ms', () => {
                  unwatch2();
                  let unwatch3 = this.$watch('formDialogMx.sum', () => {
                    unwatch3();
                    this.formDialogMx.sum = this.dialogMx.step.je || 0;
                  });
                  this.formDialogMx.yqsl = this.dialogMx.step.yqsl || 0;
                  this.formDialogMx.yqxdwsl = this.dialogMx.step.yqxdwsl || '';
                  this.dialogRemotePch(row.pc);
                  this.dialogRemoteScrq(this.formatterTime(row.scrq));
                  this.formDialogMx.pc = this.dialogMx.step.pc || '';
                  this.formDialogMx.scrq = this.dialogMx.step.scrq || '';
                });
                this.formDialogMx.ms = this.dialogMx.step.ms;
              }
            });
            this.formDialogMx = {
              ...this.formDialogMx,
              ...this.ObjectClone(__formDialogMx(), row),
            };
          }
          break;
        }
        this.dialogMx.visible = true;
      },
      dialogMxChangeBh (goodsBh) {
        // this.formDialogMx.yqsl = '';
        // this.formDialogMx.yqxdwsl = '';
        this.dialogMx.hpid.forEach(value => {
          if (value.goodsBh === goodsBh) {
            this.dialogMx.data = value;
            this.formDialogMx.mc = value.goodsName;
            this.formDialogMx.bzmc = value.bzmc;
            this.formDialogMx.ms = '';
            this.formDialogMx.scrq = '';
            this.formDialogMx.pc = '';
            this.dialogMx.packValue = {
              bzlx: '0',
            };
            this.dialogMxRemotePack(value.packId);
            this.dialogRemoteScrq('');
            this.dialogRemotePch('');
          }
        });
      },
      // 新增明细 点击执行货品编号
      async dialogMxRemoteBh1 () {
        await AutoPromise([
          async () => {
            await this.dialogMxRemoteBh('');
          },
        ]);
      },
      async dialogMxRemoteBh (Bh) {
        this.dialogMx.hpid = await this.post('/wmsshipmentorder/getGoodsByHzid', {
          bh: Bh,
        });
      },
      dialogMxChangeMs (ms) {
        // this.formDialogMx.yqsl = '';
        // this.formDialogMx.yqxdwsl = '';
        this.dialogMx.pack.forEach(value => {
          if (value.ms === ms) {
            this.dialogMx.packValue = value;
            this.formDialogMx = {
              ...this.formDialogMx,
              ...this.ObjectClone(__formDialogMx_pack(), value),
            };
          }
        });
      },
      async dialogRemoteDdlx (query) {
        this.dialog.wmsPurchaseOrder = await this.post('/wmsshipmentorder/getPoLx', {ddlx: query});
      },
      async dialogRemoteLx (id) {
        this.dialog.wmsPurchaseOrder.forEach(value => {
          if (value.id === id) {
            this.formDialog1.zdsh = value.show_zdsh;
          }
        });
      },
      async dialogRemoteKhbh (query) {
        this.dialog.wmsshipmentorder = await this.post('/wmsshipmentorder/getCusInfo', {khbh: query});
      },
      dialogRemoteKhbhid (id) {
        this.dialog.wmsshipmentorder.forEach(value => {
          console.log('value:' + value);
          if (value.id === id) {
            this.formDialog1 = {
              ...this.formDialog1,
              ...this.ObjectClone(__form1_kh(), value),
            };
            this.dialog.sheng = value.sheng;
            console.log('value.sheng:' + value.sheng);
            this.dialog.shi = value.shi;
            this.dialog.khdz = value.khdz;
            this.dialog.lxrdh = value.lxrdh;
            this.dialog.lxrxm = value.lxrxm;
          }
        });
      },
      async dialogRemoteKwmc1 () {
        await AutoPromise([
          async () => {
            await this.dialogRemoteKwmc('');
          },
        ]);
      },
      async dialogRemoteKwmc (query) {
        let data = {};
        data = await this.post('/wmsshipmentorder/getLiLibraryPosition', {mc: query});
        this.dialogMx.kwid = data;
      },
      dialogChangeKwmc (id) {
        this.dialogMx.kwid.forEach(item => {
          if (item.id === id) {
            this.dialogMx.kwData = item;
          }
        });
      },
      async dialogRemotePch (query) {
        this.dialogMx.pcid = await this.post('/wmsshipmentorder/getWmsStock', {
          hpid: this.dialogMx.data.goodsId,
          hppc: query,
        });
      },
      async dialogRemoteScrq (query) {
        this.dialogMx.rqid = await this.post('/wmsshipmentorder/getWmsStockScrq', {
          hpid: this.dialogMx.data.goodsId,
          scrq: query,
        });
      },
      async dialogMxRemotePack (packId) {
        this.dialogMx.pack = await this.get('/wmsPurchaseOrder/packDetailList/' + packId);
      },
      dialogMxSave () {
        this.VALIDATE('formDialogMx', async option => {
          let table = 'tableMx';
          if (this.dialogSearch.row.id) {
            table = 'tableSearch';
          }
          if (table === 'tableMx') {
            let check = true;
            this[table].data.forEach((value, index) => {
              if (this.dialogMx.row.bh === value.bh) {
                this[table].data.splice(index, 1);
              } else if (this.dialogMx.data.goodsBh === value.bh) {
                this.$alert(`发现货品 ${value.bh} 已经存在！`, '提示');
                check = false;
              }
            });
            if (check) {
              this[table].data.push({
                ...option,
                hpid: this.dialogMx.data.goodsId,
                zdw: this.dialogMx.packValue.id,
                je: this.formDialogMx.sum,
                kwmc: this.dialogMx.kwData.mc,
                scrq: FormatterTime(option.scrq, 31),
              });
              this[table].total++;
              this.dialogMxInit();
              this.dialogMx.visible = false;
            }
          } else {
            try {
              if (this.dialogMx.title === '新增') {
                await this.post('/wmsshipmentorderdetailed/add', {
                  ...option,
                  hpid: this.dialogMx.data.goodsId,
                  zdw: this.dialogMx.packValue.id,
                  ssfyddid: this.dialogSearch.row.id,
                  je: this.formDialogMx.sum,
                  kwmc: this.dialogMx.kwData.mc,
                  scrq: FormatterTime(option.scrq, 31),
                });
              } else {
                await this.post('/wmsshipmentorderdetailed/edit', {
                  ...option,
                  hpid: this.dialogMx.data.goodsId,
                  zdw: this.dialogMx.packValue.id,
                  ssfyddid: this.dialogSearch.row.id,
                  id: this.dialogMx.row.id,
                  je: this.formDialogMx.sum,
                  kwmc: this.dialogMx.kwData.mc,
                  scrq: FormatterTime(option.scrq, 31),
                });
              }
              this.tableSearch.data = await this.get('/wmsshipmentorder/getDetailList/' + this.dialogSearch.row.id);
              this.dialogMxInit();
              this.dialogMx.visible = false;
            } catch (err) {
              console.error(err);
            }
          }
        });
      },

      dialogSearchInit () {
        this.dialogSearch.row = {};
      },
      async dialogSearchOpen (row) {
        this.dialogSearch.row = row;
        this.tableSearch.data = await this.get('/wmsshipmentorder/getDetailList/' + row.id);
        this.dialogSearch.visible = true;
      },
      tableSearchDelete (row) {
        let id = this.dialogSearch.row.id;
        let tableRef = 'tableSearch';
        let deleteUrl = '/wmsshipmentorderdetailed/delete';
        let tips = '发运订单明细';

        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this[tableRef].multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this[tableRef].multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将删除' + tips + '。', '确认删除？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post(deleteUrl, {
                id,
                ids,
              });
              // his.tableWatch(tableRef);
              this.tableSearch.data = await this.get('/wmsshipmentorder/getDetailList/' + this.dialogSearch.row.id);
            } catch (err) {
              console.log(err);
            }
          })
          .catch(_ => {
          });
      },
      dialogSearchSave () {
        this.dialogSearchInit();
        this.dialogSearch.visible = false;
      },
      async dialogMxRemoteBz (packId) {
        this.dialogOrder.packId = await this.get('/wmsPurchaseOrder/packDetailList/' + packId);
      },

      dialogUploadInit () {},
      async dialogUploadOpen (type) {
        if (this.$refs.upload) {
          this.$refs.upload.clearFiles();
        }
        this.exporttype = type;
        this.dialogUpload.visible = true;
      },
      dialogUploadBefore (file) {
        let isExcel = false;
        let filearr = file.name.split('.');
        let filetype = filearr[filearr.length - 1];
        if (filetype.indexOf('xls') !== -1) {
          isExcel = true;
        } else {
          this.$message.error('上传文件只能是 Excel 格式!');
        }
        /* if (file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || file.type === 'application/vnd.ms-excel') {
          isExcel = true;
        }; */
        const isLt = file.size / 1024 / 1024 < 50;
        if (!isLt) {
          this.$message.error('上传头像图片大小不能超过 50MB!');
        }
        return (isExcel) && isLt;
      },
      async dialogUploadSuccess (res, file, fileList) {
        try {
          await this.post('/wmsshipmentorder/importExcle', {
            filepath: PublicImageServer.src + '/excel/zxwms/shipment/' + encodeURI(res.filename),
            type: this.exporttype,
          });
          this.tableWatch('table');
        } finally {
          this.del(this.action + '/' + res.filename);
        }
      },
      dialogUploadSubmit () {
        this.$refs.upload.submit();
      },
      dialogUploadSave () {
        this.dialogUploadInit();
        this.dialogUpload.visible = false;
      },

      clearMuti (tableRef) {
        this.$refs[tableRef].$refs[tableRef].clearSelection();
      },

      dialogAllotDetailedInit () {},
      dialogAllotDetailedOpen (row) {
        try {
          this.tableAllotDetailed.url = '/wmsdistribution/searchDetailed';
          this.tableAllotDetailed.option.id = row.id;
          this.tableWatch('tableAllotDetailed');
          this.dialogAllotDetailed.visible = true;
        } catch (err) {
          console.log(err);
        }
      },

      dialogAllotDetailedMxInit () {},
      dialogAllotDetailedMxOpen (row) {
        try {
          this.tableAllotDetailedMx.url = '/wmsdistribution/distributionDetailed';
          this.tableAllotDetailedMx.option.id = row.id;
          this.tableWatch('tableAllotDetailedMx');
          this.dialogAllotDetailedMx.visible = true;
        } catch (err) {
          console.log(err);
        }
      },
      treeContent (h, { node, data, store }) {
        return (
          <span>
            <span>
              <span>{data.lable}</span>
            </span>
          </span>);
      },
      treeClick (data, node, tree) {
        this.tree.select = data;
      },

      dialogConfigureInit () {},
      dialogConfigureOpen () {
        this.dialogConfigure.visible = true;
      },
      dialogConfigureSave () {
        this.VALIDATE('formDialogConfigure', async option => {
          try {
            await this.post('/wmsownershipmentorderconfig/add', option);
            this.tableWatch('table');
            this.dialogInit();
            this.dialogConfigure.visible = false;
          } catch (err) {
            console.log(err);
          }
        });
      },
      dialogConfigureAdd () {
        this.x.push(__x());
      },
      dialogUploadInit2 () {},
      async dialogUploadOpen2 (rowdata) {
        this.jsonpoid = rowdata;
        let json = await this.get('/wmspoenclosure/list/' + rowdata);
        let temparr = [];
        let i = 0;
        if (json.length > 0) {
          for (let value of json) {
            temparr[i] = { 'id': value.id, 'poid': value.poid, 'name': value.mc, 'url': PublicImageServer.src + '/excel/zxwms/shipment/' + value.mc };
            i++;
          }
        }
        this.tableUpload2.data = temparr;

        this.dialogUpload2.visible = true;
      },
      dialogUploadBefore2 (file) {
        /* const isExcel = file.type === 'application/vnd.ms-excel';
        const isLt = file.size / 1024 / 1024 < 50;
        if (!isExcel) {
          this.$message.error('上传文件只能是 Excel 格式!');
        }
        if (!isLt) {
          this.$message.error('上传头像图片大小不能超过 50MB!');
        }
        return (isExcel) && isLt; */
      },
      async dialogUploadSuccess2 (res, file, fileList) {
        let poid = this.jsonpoid;
        try {
          await this.post('/wmspoenclosure/add', {
            mc: res.filename,
            poid: poid,
          });
          this.filename = res.filename;
        } finally {
          this.dialogUploadOpen2(poid);
          // this.del(this.action + '/' + res.filename);
        }
      },
      dialogUploadError2 (err) {
        console.log('err', err);
      },
      downloadfile (rowid) {
        let filename = rowid.name;
        window.open(PublicImageServer.src + '/' + 'excel/zxwms/shipment/' + filename);
      },
      async dialogUploadRemove2 (res, file, fileList) {
        let id = res.poid;
        let ids = [res.id];
        try {
          await this.post('/wmspoenclosure/del', {
            id: id,
            ids: ids,
          });
          // this.tableWatch('table');
        } catch (error) {
          console.log('error:', error);
        }
      },
      dialogUploadSubmit2 () {
        this.$refs.upload2.submit();
      },
      dialogUploadSave2 () {
        this.dialogUploadInit();
        this.dialogUpload2.visible = false;
      },
      async tablePrint (row) {
        try {
          /* let postdata = await this.post('/wmsbox/printeZxmx/', {
            ssyqdid: row.id,
          }); */
          let json = await this.post('/wmsbox/printeZxmx', {
            ids: [row.id] });
          this.$confirm('您将打印箱标签信息。', '确认打印？', {
            confirmButtonText: '是',
            cancelButtonText: '否',
            type: 'warning',
          }).then(() => {
            console.log('打印箱标签信息');
            let LODOP = GetLodop();
            LODOP.PRINT_INIT('打印箱标签信息');
            let index = 0;
            let data = json.contentList;
            let leftwidth = 10;
            for (let item of data) {
              LODOP.NewPage();
              // LODOP.ADD_PRINT_RECT(5, 15, 360, 275, 0, 1); // 画边框
              LODOP.ADD_PRINT_TEXT(2, 93 + leftwidth, 250, 25, data[index].show_rent);
              LODOP.SET_PRINT_STYLEA(0, 'FontName', '隶书');
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 13);
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(31, 3 + leftwidth, 57, 20, '起始站：');
              LODOP.ADD_PRINT_TEXT(31, 63 + leftwidth, 145, 20, data[index].ownermc);
              LODOP.ADD_PRINT_TEXT(31, 210 + leftwidth, 57, 20, '收货人：');
              LODOP.ADD_PRINT_TEXT(31, 276 + leftwidth, 100, 20, data[index].lxrxm);
              LODOP.ADD_PRINT_TEXT(53, 3 + leftwidth, 57, 20, '订单号：');
              LODOP.ADD_PRINT_TEXT(53, 63 + leftwidth, 145, 20, data[index].sobh);
              LODOP.ADD_PRINT_TEXT(53, 210 + leftwidth, 69, 20, '联系电话：');
              LODOP.ADD_PRINT_TEXT(53, 276 + leftwidth, 81, 20, data[index].lxrdh);
              LODOP.ADD_PRINT_TEXT(76, 3 + leftwidth, 69, 20, '收货地址：');
              LODOP.ADD_PRINT_TEXT(76, 67 + leftwidth, 291, 37, data[index].khdz);
              LODOP.ADD_PRINT_TEXT(123, 3 + leftwidth, 124, 20, '散箱数量：' + data[index].sxsl);
              LODOP.ADD_PRINT_TEXT(123, 118 + leftwidth, 104, 20, '整箱数量：' + data[index].zxsl);
              LODOP.ADD_PRINT_TEXT(123, 220 + leftwidth, 138, 20, '当前：' + data[index].xxh + '/' + data[index].maxXxh + ' ' + data[index].zslx);
              LODOP.ADD_PRINT_RECT(0, 0 + leftwidth, '100mm', '80mm', 0, 1); // 外边框
              // LODOP.ADD_PRINT_RECT(136, 0 + leftwidth, '100mm', 111, 0, 1); // 明细边框
              LODOP.ADD_PRINT_LINE(136, 10 , 136 , '102mm' , 0, 1); // 横线
              LODOP.ADD_PRINT_TEXT(138, 2 + leftwidth, 36, 20, '序号');
              LODOP.ADD_PRINT_TEXT(138, 45 + leftwidth, 167, 20, '货品名称');
              LODOP.ADD_PRINT_TEXT(138, 210 + leftwidth, 34, 20, '规格');
              LODOP.ADD_PRINT_TEXT(138, 295 + leftwidth, 36, 20, '单位');
              LODOP.ADD_PRINT_TEXT(138, 339 + leftwidth, 35, 20, '数量');
              if (data[index].boxMx.length > 0) {
                let height;
                for (let mx = 0, mcx = 0; mx < data[index].boxMx.length; mx++, mcx++) {
                  let datalength = data[index].boxMx.length;
                  console.log('datalength', datalength);
                  console.log('mmmmx', mx);
                  let mcxs;
                  if (mx < 7) {
                    height = 158;
                    mcxs = mcx;
                  } else if (mx < 22) {
                    height = 10;
                    mcxs = mcx - 7;
                  } else {
                    height = 10;
                    mcxs = mcx - 22;
                  }
                  LODOP.ADD_PRINT_TEXT(height + mcxs * 20, 1 + leftwidth, 37, 20, mx + 1);
                  LODOP.ADD_PRINT_TEXT(height + mcxs * 20, 45 + leftwidth, 167, 20, data[index].boxMx[mx].goodsMc);
                  LODOP.ADD_PRINT_TEXT(height + mcxs * 20, 200 + leftwidth, 122, 20, data[index].boxMx[mx].gg || ''); // 规格
                  LODOP.ADD_PRINT_TEXT(height + mcxs * 20, 296 + leftwidth, 34, 20, data[index].boxMx[mx].dw || ''); // 单位
                  LODOP.ADD_PRINT_TEXT(height + mcxs * 20, 339 + leftwidth, 48, 20, data[index].boxMx[mx].sl);
                  if (datalength < 5) {
                    LODOP.ADD_PRINT_LINE(246, 10 , 246 , '102mm' , 0, 1);
                  } else if (datalength >= 5 && datalength < 7) {
                    if (mx === (datalength - 1)) {
                      console.log('分页');
                      LODOP.NewPage();
                      LODOP.ADD_PRINT_RECT(0, 0 + leftwidth, '100mm', '80mm', 0, 1);
                      LODOP.ADD_PRINT_LINE(246, 10 , 246 , '102mm' , 0, 1);
                    }
                  } else if (datalength >= 7 && datalength < 19) {
                    if (mx === 6) {
                      console.log('分页');
                      LODOP.NewPage();
                      LODOP.ADD_PRINT_RECT(0, 0 + leftwidth, '100mm', '80mm', 0, 1);
                      LODOP.ADD_PRINT_LINE(246, 10 , 246 , '102mm' , 0, 1);
                    }
                  } else if (datalength >= 19 && datalength < 22) {
                    if (mx === 6 || mx === (datalength - 1)) {
                      console.log('分页');
                      LODOP.NewPage();
                      LODOP.ADD_PRINT_RECT(0, 0 + leftwidth, '100mm', '80mm', 0, 1);
                      if (mx === (datalength - 1)) {
                        LODOP.ADD_PRINT_LINE(246, 10 , 246 , '102mm' , 0, 1);
                      }
                    }
                  } else if (datalength >= 22) {
                    if (mx === 6 || mx === 21) {
                      console.log('分页');
                      LODOP.NewPage();
                      LODOP.ADD_PRINT_RECT(0, 0 + leftwidth, '100mm', '80mm', 0, 1);
                      if (mx === 21) {
                        LODOP.ADD_PRINT_LINE(246, 10 , 246 , '102mm' , 0, 1);
                      }
                    }
                  }
                }
              }
              LODOP.ADD_PRINT_LINE(247, 95 + leftwidth, 302, 95 + leftwidth, 0, 1); // 画竖线
              LODOP.ADD_PRINT_TEXT(257, 1 + leftwidth, 98, 37, data[index].xx); // 箱型
              LODOP.ADD_PRINT_TEXT(267, 1 + leftwidth, 110, 40, data[index].llzl); // 理论重量
              LODOP.ADD_PRINT_BARCODE(250, 103 + leftwidth, 251, 49, 'Code39', data[index].xbh);
              index++;
            }
            LODOP.PREVIEW();
          });
        } catch (err) {
          console.log(err);
        }
      },
      async tableMutiPrint (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一条已装箱的订单！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        try {
          var count;
          var number = 10;
          count = ids.length / number;
          var countsun = Math.ceil(count);
          for (let j = 1; j <= countsun; j++) {
            let $ids = ids.slice((j - 1) * number,j * number);
            var {contentList} = await this.post('/wmsbox/printeZxmx', {
              ids: $ids,
            });
          }
          this.$confirm('您将打印箱标签信息。', '确认打印？', {
            confirmButtonText: '是',
            cancelButtonText: '否',
            type: 'warning',
          }).then(() => {
            // this.$message('开始打印箱标签');
            let LODOP = GetLodop();
            // 打印初始化
            LODOP.PRINT_INIT('打印箱标签信息');
            let index = 0;
            // let data = json.contentList;
            let leftwidth = 10;
            for (let item of contentList) {
              LODOP.NewPage();
              // LODOP.ADD_PRINT_RECT(5, 15, 360, 275, 0, 1); // 画边框
              LODOP.ADD_PRINT_TEXT(2, 93 + leftwidth, 250, 25, contentList[index].show_rent);
              LODOP.SET_PRINT_STYLEA(0, 'FontName', '隶书');
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 13);
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(31, 3 + leftwidth, 57, 20, '起始站：');
              LODOP.ADD_PRINT_TEXT(31, 63 + leftwidth, 145, 20, contentList[index].ownermc);
              LODOP.ADD_PRINT_TEXT(31, 210 + leftwidth, 57, 20, '收货人：');
              LODOP.ADD_PRINT_TEXT(31, 276 + leftwidth, 100, 20, contentList[index].lxrxm);
              LODOP.ADD_PRINT_TEXT(53, 3 + leftwidth, 57, 20, '订单号：');
              LODOP.ADD_PRINT_TEXT(53, 63 + leftwidth, 145, 20, contentList[index].sobh);
              LODOP.ADD_PRINT_TEXT(53, 210 + leftwidth, 69, 20, '联系电话：');
              LODOP.ADD_PRINT_TEXT(53, 276 + leftwidth, 81, 20, contentList[index].lxrdh);
              LODOP.ADD_PRINT_TEXT(76, 3 + leftwidth, 69, 20, '收货地址：');
              LODOP.ADD_PRINT_TEXT(76, 67 + leftwidth, 291, 37, contentList[index].khdz);
              LODOP.ADD_PRINT_TEXT(123, 3 + leftwidth, 124, 20, '散箱数量：' + contentList[index].sxsl);
              LODOP.ADD_PRINT_TEXT(123, 118 + leftwidth, 104, 20, '整箱数量：' + contentList[index].zxsl);
              LODOP.ADD_PRINT_TEXT(123, 220 + leftwidth, 138, 20, '当前：' + contentList[index].xxh + '/' + contentList[index].maxXxh + ' ' + contentList[index].zslx);
              LODOP.ADD_PRINT_RECT(0, 0 + leftwidth, '100mm', '80mm', 0, 1); // 外边框
              // LODOP.ADD_PRINT_RECT(136, 0 + leftwidth, '100mm', 111, 0, 1); // 明细边框
              LODOP.ADD_PRINT_LINE(136, 10 , 136 , '102mm' , 0, 1); // 横线
              LODOP.ADD_PRINT_TEXT(138, 2 + leftwidth, 36, 20, '序号');
              LODOP.ADD_PRINT_TEXT(138, 45 + leftwidth, 167, 20, '货品名称');
              LODOP.ADD_PRINT_TEXT(138, 210 + leftwidth, 34, 20, '规格');
              LODOP.ADD_PRINT_TEXT(138, 295 + leftwidth, 36, 20, '单位');
              LODOP.ADD_PRINT_TEXT(138, 339 + leftwidth, 35, 20, '数量');
              if (contentList[index].boxMx.length > 0) {
                let height;
                for (let mx = 0, mcx = 0; mx < contentList[index].boxMx.length; mx++, mcx++) {
                  let datalength = contentList[index].boxMx.length;
                  console.log('datalength', datalength);
                  console.log('mmmmx', mx);
                  let mcxs;
                  if (mx < 7) {
                    height = 158;
                    mcxs = mcx;
                  } else if (mx < 22) {
                    height = 10;
                    mcxs = mcx - 7;
                  } else {
                    height = 10;
                    mcxs = mcx - 22;
                  }
                  LODOP.ADD_PRINT_TEXT(height + mcxs * 20, 1 + leftwidth, 37, 20, mx + 1);
                  LODOP.ADD_PRINT_TEXT(height + mcxs * 20, 45 + leftwidth, 167, 20, contentList[index].boxMx[mx].goodsMc);
                  LODOP.ADD_PRINT_TEXT(height + mcxs * 20, 200 + leftwidth, 122, 20, contentList[index].boxMx[mx].gg || ''); // 规格
                  LODOP.ADD_PRINT_TEXT(height + mcxs * 20, 296 + leftwidth, 34, 20, contentList[index].boxMx[mx].dw || ''); // 单位
                  LODOP.ADD_PRINT_TEXT(height + mcxs * 20, 339 + leftwidth, 48, 20, contentList[index].boxMx[mx].sl);
                  if (datalength < 5) {
                    LODOP.ADD_PRINT_LINE(246, 10 , 246 , '102mm' , 0, 1);
                  } else if (datalength >= 5 && datalength < 7) {
                    if (mx === (datalength - 1)) {
                      console.log('分页');
                      LODOP.NewPage();
                      LODOP.ADD_PRINT_RECT(0, 0 + leftwidth, '100mm', '80mm', 0, 1);
                      LODOP.ADD_PRINT_LINE(246, 10 , 246 , '102mm' , 0, 1);
                    }
                  } else if (datalength >= 7 && datalength < 19) {
                    if (mx === 6) {
                      console.log('分页');
                      LODOP.NewPage();
                      LODOP.ADD_PRINT_RECT(0, 0 + leftwidth, '100mm', '80mm', 0, 1);
                      LODOP.ADD_PRINT_LINE(246, 10 , 246 , '102mm' , 0, 1);
                    }
                  } else if (datalength >= 19 && datalength < 22) {
                    if (mx === 6 || mx === (datalength - 1)) {
                      console.log('分页');
                      LODOP.NewPage();
                      LODOP.ADD_PRINT_RECT(0, 0 + leftwidth, '100mm', '80mm', 0, 1);
                      if (mx === (datalength - 1)) {
                        LODOP.ADD_PRINT_LINE(246, 10 , 246 , '102mm' , 0, 1);
                      }
                    }
                  } else if (datalength >= 22) {
                    if (mx === 6 || mx === 21) {
                      console.log('分页');
                      LODOP.NewPage();
                      LODOP.ADD_PRINT_RECT(0, 0 + leftwidth, '100mm', '80mm', 0, 1);
                      if (mx === 21) {
                        LODOP.ADD_PRINT_LINE(246, 10 , 246 , '102mm' , 0, 1);
                      }
                    }
                  }
                }
              }
              LODOP.ADD_PRINT_LINE(247, 95 + leftwidth, 302, 95 + leftwidth, 0, 1); // 画竖线
              LODOP.ADD_PRINT_TEXT(257, 1 + leftwidth, 98, 37, contentList[index].xx); // 箱型
              LODOP.ADD_PRINT_TEXT(267, 1 + leftwidth, 110, 40, contentList[index].llzl); // 理论重量
              LODOP.ADD_PRINT_BARCODE(250, 103 + leftwidth, 251, 49, 'Code39', contentList[index].xbh);
              index++;
            }
            LODOP.PREVIEW(); // 预览打印
            // LODOP.PRINT(); // 不预览直接打印
            // LODOP.PRINT_INIT('正在打印中');
            // alert('正在打印中');
          });
          // alert('正在打印中');
        } catch (err) {
          console.log(err);
        }
      },
      tableMultiPrint () {
        let startX = 5;
        let startY = 25;
        let width = 206;
        let height = 78;
        let bottom = 10;
        this.$confirm(`您将打印 ${this.table.multipleSelection.length} 个库位信息。`, '确认打印？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        }).then(() => {
          let i = 0;
          let LODOP = GetLodop();
          LODOP.PRINT_INIT('打印库位信息');
          this.table.multipleSelection.sort((a, b) => {
            return parseInt(a.xlsx) - parseInt(b.xlsx);
          });
          for (let item of this.table.multipleSelection) {
            LODOP.ADD_PRINT_BARCODE(startX + (bottom + height) * i, startY, width, height, '128A', item.mc);
            i++;
          }
          LODOP.PREVIEW();
        });
      },
      dialogCreateInit () {
        this.formDialogCreate = {
          ...this.formDialogCreate,
          ...this.ObjectClone(__formCreate()),
        };
        this.resetFields('formDialogCreate');
      },
      async dialogCreateOpen (row) {
        await AutoPromise([
          async () => {
            await this.dialogRemoteCyslbmc('');
          },
        ]);
        this.dialogCreate.row = row;
        this.dialogCreate.visible = true;
      },
      async dialogRemoteCyslbmc (query) {
        this.dialogCreate.wmsshipmentorder = await this.post('/wmsshipmentorder/selectCyslb', {d_name: query});
      },
      async dialogRemoteCyslbmcId (id) {
        this.dialogCreate.wmsshipmentorder.forEach(value => {
          if (value.id === id) {
            this.dialogCreate.cyslb = value.d_value;
          }
        });
      },
      dialogCreateSave () {
        this.VALIDATE('formDialogCreate', async option => {
          let json = {
            ids: [this.dialogCreate.row.id],
            cyslb: this.dialogCreate.cyslb,
          };
          try {
            await this.post('/wmsshipmentorder/updateCyslb', json);
            this.dialogCreateInit();
            this.tableWatch('table');
            this.dialogCreate.visible = false;
          } catch (err) {
            console.log(err);
          }
        });
      },
      dialogCysInit () {
        this.formDialogCys = {
          ...this.formDialogCys,
          ...this.ObjectClone(__formCys()),
        };
        this.resetFields('formDialogCys');
      },
      async dialogCysOpen (table) {
        await AutoPromise([
          async () => {
            await this.dialogRemoteCyslbmc('');
          },
        ]);
        this.dialogCys.table = table;
        this.dialogCys.visible = true;
      },
      dialogCysSave () {
        let ids = [];
        let tableRef = this.dialogCys.table;
        if (this[tableRef].multipleSelection.length < 1) {
          return this.$alert('您还未选择，请您至少选择一个！', '提示');
        }
        this.VALIDATE('formDialogCys', async option => {
          this[tableRef].multipleSelection.forEach(item => {
            ids.push(item.id);
          });
          let json = {
            ids: ids,
            cyslb: this.dialogCreate.cyslb,
          };
          try {
            await this.post('/wmsshipmentorder/updateCyslb', json);
            this.dialogCreateInit();
            this.tableWatch('table');
            this.dialogCysInit();
            this.dialogCys.visible = false;
          } catch (err) {
            console.log(err);
          }
        });
      },
    },
    computed: {
      formDialogMxje: function () {
        return this.formDialogMx.je;
        /*
        if (this.formDialogMx.yqsl) {
          return this.formDialogMx.je * this.formDialogMx.yqsl;
        } else {
          return this.formDialogMx.je;
        }
        */
      },
      formDialogMxzl: function () {
        if (this.formDialogMx.yqsl) {
          return this.formDialogMx.zl * this.formDialogMx.yqsl;
        } else {
          return this.formDialogMx.zl;
        }
      },
      formDialogMxjz: function () {
        if (this.formDialogMx.yqsl) {
          return this.formDialogMx.jz * this.formDialogMx.yqsl;
        } else {
          return this.formDialogMx.jz;
        }
      },
      formDialogMxtj: function () {
        if (this.formDialogMx.yqsl) {
          return this.formDialogMx.tj * this.formDialogMx.yqsl;
        } else {
          return this.formDialogMx.tj;
        }
      },
      action: function () {
        return PublicImageServer.src + '/' + PublicImageServer.upload + '/excel/zxwms/shipment';
      },
    },
    watch: {
      'formDialogMx.yqsl': function (item) {
        let sum = parseInt(this.formDialogMx.je * this.formDialogMx.yqsl);
        this.formDialogMx.sum = isNaN(sum) ? 0 : sum;
        if (item && this.dialogMx.packValue.bzlx === '0' && this.dialogMx.packValue.zdwsl) {
          let zdwsl = parseInt(this.dialogMx.packValue.zdwsl);
          let source = parseInt(item);
          this.formDialogMx.yqxdwsl = `${Math.floor(source / zdwsl)}箱${source % zdwsl}件`;
        }
      },
      'formDialogMx.yqxdwsl': function (item) {
        if (item && this.dialogMx.packValue.bzlx !== '0' && this.dialogMx.packValue.zdwsl) {
          let reg = /(\d{1,5})箱(\d{1,5})件/;
          if (reg.test(item)) {
            let zdwsl = parseInt(this.dialogMx.packValue.zdwsl);
            let source = reg.exec(item);
            let xiang = parseInt(source[1]);
            let jian = parseInt(source[2]);
            this.formDialogMx.yqsl = xiang * zdwsl + jian + '';
          }
        }
      },
    },
    mounted: async function () {
      console.log(this);
      /* AutoPromise: 同时执行两个await */
      await AutoPromise([
        async () => {
          if (!this.DICTIONARY_shipment) {
            await this.USE('DICTIONARY_shipment');
          }
        },
        async () => {
          let json = await this.get('/wmsshipmentorder/getFyColumnName');
          json.forEach(item => {
            this.table.tableColumnAll.push({
              label: item.value,
              prop: item.zcolumn,
              minWidth: '0px',
              search: false,
            });
          });
        },
        async () => {
          if (this.dialog.wmsPurchaseOrder.length === 0) {
            this.dialog.wmsPurchaseOrder = await this.post('/wmsshipmentorder/getPoLx', {
            });
          }
        },
      ]);
      this.tableWatch('table');
      if (this.ORDERCHANNEL.orderChannel.length === 0) {
        this.SET('ORDERCHANNEL', await this.post('/wmsorderchannel/list'));
      }
      this.tree.data = [{
        id: '0',
        lable: '订单渠道',
        orderChannelLevel: '-1',
        children: this.ORDERCHANNEL.orderChannel,
      }];
    },
  });
  function header () {
    return `
<head>
<style>
/* reset */
html {
  overflow: hidden;
}

body, div, dl, dt, dd, ul, ol, li, pre, code, form, fieldset, legend, textarea, blockquote, th, td, input, select, textarea, button {
  margin: 0;
  padding: 0
}

/* 重置fieldset（表单分组）、图片的边框为0*/
dl, ul, ol, menu, li {
  list-style: none
}

/* 重置类表前导符号为onne,menu在HTML5中有效 */
blockquote, q {
  quotes: none
}

/* 重置嵌套引用的引号类型 */
blockquote:before, blockquote:after, q:before, q:after {
  content: '';
  content: none
}

/* 重置嵌套引用*/
input, select, textarea, button {
  vertical-align: middle
}

/* 重置表单控件垂直居中*/
button {
  border: 0 none;
  background-color: transparent;
  cursor: pointer
}

/* 重置表单button按钮效果 */
body {
  background: #fff
}

/* 重置body 页面背景为白色 */
body, th, td, input, select, textarea, button {
}

/*清除浮动--推荐使用*/
.clearfix:before, .clearfix:after {
  content: '';
  display: table;
}
.el-form-item:before, .el-form-item:after {
  content: '';
  display: table;
}

.el-form-item:after {
  clear: both;
}
.clearfix:after {
  clear: both;
}

.el-card {
    border: 1px solid #d1dbe5;
    border-radius: 4px;
    background-color: #fff;
    overflow: hidden;
    box-shadow: 0 2px 4px 0 rgba(0,0,0,.12), 0 0 6px 0 rgba(0,0,0,.04);
}

.el-card__header {
    padding: 18px 20px;
    border-bottom: 1px solid #d1dbe5;
    box-sizing: border-box;
}

.el-card__body {
    padding: 20px;
}

.el-row {
    position: relative;
    box-sizing: border-box;
}

.el-progress-bar__inner:after, .el-row:after, .el-row:before, .el-slider:after, .el-slider:before, .el-slider__button-wrapper:after, .el-upload-cover:after {
    content: "";
}

.el-row:after, .el-row:before {
    display: table;
}

  .mapanPrint .el-card__body{
    padding: 0 20px 20px;
  }
  .mapanPrint .title span{
    float: right;
  }
  .mapanbh{
    float: left;
    width: 50%;
  }
  .asnbh{
    height: 45px;
  }
  .mapanPrint .el-form-item{
    margin-bottom: 10px;
  }
.el-form-item__label {
    text-align: right;
    vertical-align: middle;
    float: left;
    font-size: 14px;
    color: #48576a;
    line-height: 1;
    padding: 11px 12px 11px 0;
    box-sizing: border-box;
}


.el-form-item__content {
    line-height: 36px;
    position: relative;
    font-size: 14px;
    float: left;
}
.s-content{
  display:inline-block;
}
.title{
    float: left;
    width: 50%;
  }
.title .right{
    float: right;
  }
html{width:378px;height:302px;overflow:hidden;}
</style>
</head>
    `;
  }
</script>
<style scoped lang="scss">
  .box-card {
    margin: 20px;
  }

  .createTimeSpan {
    display: block;
    margin-top: 34px;
  }

  @media screen and (max-width: 800px) {
    .createTimeSpan {
      margin-top: 0;
    }
    .box-card {
      margin: 0;
    }
  }

  .el-select {
    width: 100%;
  }
  .el-table .warning-row {
    background: #ff4949;
  }
</style>

<style lang="scss">
  .el-dialog--small {
    width: 90%;
  }
</style>
